0.0.53 • Published 4 months ago

subjecto v0.0.53

Weekly downloads
153
License
MIT
Repository
-
Last release
4 months ago

Gitpod ready-to-code CircleCI npm

Subjecto

What is it?

Subjecto is a minimalistic state management library with no dependencies. Its API is inspired from RxJs' Subject.

API

import { subject } from "subjecto";

// init
const value = new subject(new Date().toISOString())

// subscribe
const handler = value.subscribe((newValue) => {
  console.log("subscription 1", newValue);
});

// optionally, set debug to true to see all listeners and value updates
value.debug = true;

// push a new value
value.next(new Date().toISOString());

// get handlers uid
console.log(handler.id);

// unsubscribe
handler.unsubscribe();

// flush all subscriptions
value.complete();

Live Demo

https://codesandbox.io/s/distracted-meadow-vsqwd?file=/src/index.ts

Licence

MIT

0.0.51

4 months ago

0.0.52

4 months ago

0.0.53

4 months ago

0.0.50

5 months ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.0.39

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.34

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.27

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.26

3 years ago

0.0.22

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.19

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago