diff --git a/src/renderer/store/helpers/index.js b/src/renderer/store/helpers/index.js index 6cfa574..4b14ffb 100644 --- a/src/renderer/store/helpers/index.js +++ b/src/renderer/store/helpers/index.js @@ -1,3 +1,4 @@ export { default as global } from './global' export { default as localLists } from './localLists' +export { default as services } from './services' diff --git a/src/renderer/store/helpers/services.js b/src/renderer/store/helpers/services.js new file mode 100644 index 0000000..2e586c4 --- /dev/null +++ b/src/renderer/store/helpers/services.js @@ -0,0 +1,40 @@ +import { providers } from '../modules/lists' + +import createNamespace from './createNamespace' + +const PREFIX = '__s' +const NAMESPACE = 'services' + +export default createNamespace( + NAMESPACE, + PREFIX, + { + // Brings __sSet, __sHasUser, __sIsConnected, __sGetList, __sUpdateList + // and __sExternal + actions: [ + 'set', + 'hasUser', + 'isConnected', + 'getList', + 'updateList', + 'external' + ], + // Brings __sSetUser, __sHasUser, __sSetValue, __sSetConnected, __sSetLoading, + // __sSetList, __sSetError, __sShowForm and__sSetFormEntry + mutations: [ + 'setUser', + 'hasUser', + 'setValue', + 'setConnected', + 'setLoading', + 'setList', + 'setError', + 'showForm', + 'setFormEntry' + ], + // Brings __s + state: [ + ...providers.map(({ value }) => value) + ] + } +)