UNPKG

linked-data-reactor

Version:

Linked Data Reactor provides a framework to view, browse and edit Linked Data in a flexible way.

31 lines (27 loc) 703 B
import {BaseStore} from 'fluxible/addons'; class QueryImportStore extends BaseStore { constructor(dispatcher) { super(dispatcher); this.queries = {}; } updateQueriesSaved(payload) { this.queries = payload.states; this.emitChange(); } getState() { return { queries: this.queries }; } dehydrate() { return this.getState(); } rehydrate(state) { this.queries = state.queries; } } QueryImportStore.storeName = 'QueryImportStore'; // PR open in dispatchr to remove this need QueryImportStore.handlers = { 'UPDATE_QUERIES_SAVED': 'updateQueriesSaved' }; export default QueryImportStore;