summaryrefslogtreecommitdiffstats
path: root/src/util.coffee
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-05 18:10:35 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-05 18:10:35 +0100
commit3280ab57bffb3fa1018d406eb25a3d98564a51d7 (patch)
tree02c5d76d89b94b964a7cc005531c6c4427666bc0 /src/util.coffee
parentb910818f176d009a9b98a419b645b6c7e1cb1d20 (diff)
downloadrpgedit-3280ab57bffb3fa1018d406eb25a3d98564a51d7.tar
rpgedit-3280ab57bffb3fa1018d406eb25a3d98564a51d7.zip
Implement basic map rendering
Diffstat (limited to 'src/util.coffee')
-rw-r--r--src/util.coffee12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.coffee b/src/util.coffee
new file mode 100644
index 0000000..d2cea04
--- /dev/null
+++ b/src/util.coffee
@@ -0,0 +1,12 @@
+'use strict'
+
+_ = require 'lodash'
+
+module.exports =
+ mapPromises: (promises) ->
+ _.reduce promises, ((seq, v, k) ->
+ seq.then (acc) ->
+ v.then (r) ->
+ acc[k] = r
+ acc
+ ), Promise.resolve {}