Writable Store
Tiny tiny state management package inspired by Svelte stores.
Installation
$ npm i writable-store
Setup
Import writable
and create a writable store with an initial state:
const todoStore =
Import the store inside your component and subscribe to receive updated values:
const $todos = todoStore
You can use the value received after subscription to update component props, state etc...
To update the store with a new value:
todoStore
To retreive the current store value:
todoStore
Remember to unsubscribe during cleanup / unmounting:
$todos