From e0b0b2f976c61225a178c7715caf2656a1f6741f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 15 Dec 2018 21:32:51 +0100 Subject: moving stuff --- client/types.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 client/types.js (limited to 'client/types.js') 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' -- cgit v1.2.3-70-g09d2