ng-storex
v1.0.28
Published
DynamicStore
Downloads
15
Readme
StoreX
Dynamic Store - Beta version
Easy way to manage application state
Get started
install
npm i ng-storex
import
import {Store, StoreX} from 'ng-storex'
Create store
const store = Store.createStore({
header: 'Hello world',
user: {
name: 'Welcome'
}
});
Now you can watch for changes in component
// observe header changes
store.header.subscribe(headerChanged => console.log(headerChanged));
// use as normal value
console.log(store.header);
and use in template
{{store?.header | async }}
{{store?.user?.name }}
Change as you like
this.store.header = 'change';
this.store.user = {name: 'all object'};
this.store.user.name = 'or only value'