Closed datdefboi closed 5 years ago
private _storages: IStorage[] = []; get storages() { return this._storages } @mutation add_storage(payload: IStorage) { this._storages.push(payload); } private _systemStorage?: IStorage = undefined; get systemStorage() { return this._systemStorage } @mutation change_systemStorage(payload: IStorage) { this._systemStorage = payload; } private _userFolder: string = ""; get userFolder() { return this._userFolder } @mutation change_userFolder(payload: string) { this._userFolder = payload; }
May be we can introduce a new decorator like @managed? There is an example:
@managed systemStorage: IStorage;
or more complex example
@managed((payload, value) => { value.push(payload) }) storages: IStorage[];
and then just get\set it
this.storages = ... let temp = this.storages
The new API addresses the issue of boilerplate in stores.
Thanks for the suggestion.
May be we can introduce a new decorator like @managed? There is an example:
or more complex example
and then just get\set it