EZStore
whats that?
EZStore is an observable key value store implementation.
how can i use it?
npm i --save ezstore
how does it work?
import it
create a store
const myStore = data: buttonVisible: false mySlogan: "Capture the world" ;
listen to changes on store keys
store
get the value of a key in the store
store;
set a new value to a key in the store
store;
unsubscribe
const id = store store;
events
;// Create the storeconst store = data: buttonRendered: false timer: 5 events: { store; store; } store
example snippet
;// Create the storeconst store = data: buttonRendered: false timer: 5 events: { ; store; store; } // Create a buttonlet myButton = document;myButtonid = "myButton"; // Create a timerlet timer = document;timerinnerHTML = store;documentbody; // Listen to buttonRendered changes in store store // Listen to timer changes in storeconst timerSubscriptionId = store // Init a counter that counts from 5 to 0 and renders a button afterwardsconst counter =