summaryrefslogtreecommitdiff
path: root/client/types.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/types.js')
-rw-r--r--client/types.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/types.js b/client/types.js
new file mode 100644
index 0000000..6311816
--- /dev/null
+++ b/client/types.js
@@ -0,0 +1,16 @@
+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 api = tagAsType('api', [
+ 'loading', 'loaded', 'error',
+])
+
+export const system = tagAsType('system', [
+])
+
+export const init = '@@INIT'