mirror of https://github.com/Kylart/KawAnime.git
Created services shorthand helpers
This commit is contained in:
parent
0e3c99e532
commit
ffb4c75aeb
|
@ -1,3 +1,4 @@
|
|||
export { default as global } from './global'
|
||||
|
||||
export { default as localLists } from './localLists'
|
||||
export { default as services } from './services'
|
||||
|
|
|
@ -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<providerName>
|
||||
state: [
|
||||
...providers.map(({ value }) => value)
|
||||
]
|
||||
}
|
||||
)
|
Loading…
Reference in New Issue