diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:32:51 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:32:51 +0100 |
| commit | e0b0b2f976c61225a178c7715caf2656a1f6741f (patch) | |
| tree | 78a0e5c861462822d212c065f0825c906209bfe9 /client/types.js | |
| parent | c5b02ffab8d388e8a2925e51736b902a48a95e71 (diff) | |
moving stuff
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' |
