Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class StoreClass {
- constructor() {
- this._store = {
- name:'',
- type:''
- };
- this.rootComponent = {};
- }
- defineRootComponent(component) {
- this.rootComponent = component;
- }
- get() {
- return this._store;
- }
- setState(newValue) {
- this._store = {
- ...this._store,
- ...newValue
- };
- this.rootComponent.forceUpdate();
- }
- }
- export const Store = new StoreClass();
Add Comment
Please, Sign In to add comment