summaryrefslogtreecommitdiff
path: root/frontend/app/api/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/api/index.js')
-rw-r--r--frontend/app/api/index.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/app/api/index.js b/frontend/app/api/index.js
new file mode 100644
index 0000000..c3d0aa4
--- /dev/null
+++ b/frontend/app/api/index.js
@@ -0,0 +1,24 @@
+import { crud_actions } from 'app/api/crud.actions'
+import * as util from 'app/api/utils'
+
+/*
+for our crud events, create corresponding actions
+the actions fire a 'loading' event, call the underlying api method, and then resolve.
+so you can do ...
+ import { folderActions } from 'app/api'
+ folderActions.index({ module: 'samplernn' })
+ folderActions.show(12)
+ folderActions.create({ module: 'samplernn', name: 'foo' })
+ folderActions.update(12, { module: 'pix2pix' })
+ folderActions.destroy(12, { confirm: true })
+ folderActions.upload(12, form_data)
+*/
+
+export { util }
+
+export const actions = [
+ 'graph',
+ 'page',
+ 'tile',
+ 'upload',
+].reduce((a,b) => (a[b] = crud_actions(b)) && a, {})