summaryrefslogtreecommitdiff
path: root/client/types.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-04-28 15:54:41 +0200
committerJules Laplace <julescarbon@gmail.com>2019-04-28 15:54:41 +0200
commitaa5638a1c31ce56d59696580f33733dcf0d7764c (patch)
treec2d1bd0e480b9bae113ce9af706927c5b7c55952 /client/types.js
parenta72ecc91db39ac5a2d60aefc6d767da457500dde (diff)
refactor frontend, add threshold slider
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'