diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-11-03 17:29:49 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-11-03 17:29:49 +0100 |
| commit | aa0470a3076f5ac65a0311c76e58254547f3eae0 (patch) | |
| tree | 001173d70a0ae93d367773453cbdc9091bbc9fb7 /client/types.js | |
| parent | 3e534be7b919bf402d3602fde5b45809201f06b1 (diff) | |
begin client
Diffstat (limited to 'client/types.js')
| -rw-r--r-- | client/types.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/client/types.js b/client/types.js new file mode 100644 index 00000000..e3c64691 --- /dev/null +++ b/client/types.js @@ -0,0 +1,21 @@ +export const asType = (type, name) => [type, name].join('_').toUpperCase() +export const tagAsType = (type, names) => ( + names.reduce((tags, name) => { + tags[name] = asType(type, name) + return tags + }, {}) +) + +export const metadata = tagAsType('metadata', [ + 'loading', 'loaded', 'loaded_many', 'error', 'set_hash' +]) + +export const search = tagAsType('search', [ + 'loading', 'loaded', 'error', 'panic', 'update_options', +]) + +export const review = tagAsType('review', [ + 'loading', 'loaded', 'error', 'save', 'unsave', 'refresh', 'clear', 'dedupe', 'create', 'set_count' +]) + +export const init = '@@INIT' |
