Closed dwalker11 closed 8 years ago
When creating a store using an object literal:
var FoodStore = alt.createStore({ displayName: 'FoodStore', bindListeners: { addItem: foodActions.addItem }, state: { foods: [] }, publicMethods: { hasFood: function () { return !!this.getState().foods.length; } }, addItem: function (item) { var foods = this.state.foods; foods.push(item); this.setState({ foods: foods }); } });
there is no way to register asynchronous functions as you would when using the class syntax.
class SearchStore { constructor() { this.state = { value: '' }; this.registerAsync(SearchSource); } } alt.createStore(SearchStore, 'SearchStore');
Other than using ES6 class syntax or ES5 constructor/prototype syntax, can we specify a property to handle the registration of an Asynchronous dataSource object?
When creating a store using an object literal:
there is no way to register asynchronous functions as you would when using the class syntax.
Other than using ES6 class syntax or ES5 constructor/prototype syntax, can we specify a property to handle the registration of an Asynchronous dataSource object?