Skip to content

Commit

Permalink
- return Promise in init if datadom is inited with node to unify init
Browse files Browse the repository at this point in the history
   return value in different cases.
  • Loading branch information
zbryikt committed Dec 30, 2020
1 parent a41cf13 commit 1c17000
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.0.4

- return Promise in init if datadom is inited with node to unify init return value in different cases.


# 0.0.3

- fix bug: update with ops should wrap ops in Array when applying.
Expand Down
6 changes: 4 additions & 2 deletions dist/datadom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datadom.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@plotdb/datadom",
"license": "MIT",
"description": "dom serializer / deserializer",
"version": "0.0.3",
"version": "0.0.4",
"files": [
"dist/**/*"
],
Expand Down
2 changes: 1 addition & 1 deletion src/datadom.ls
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ main = (opt = {}) ->
main.prototype = Object.create(Object.prototype) <<< do
plugin: (o,p) -> if @plugins.length => @plugins.map(-> it o,p) else o
init: ->
if @node => @data = serialize(@node, (o,p) ~> @plugin o,p)
if @node => Promise.resolve!then ~> @data = serialize(@node, (o,p) ~> @plugin o,p)
else
deserialize(@data, (o,p) ~> @plugin o,p)
# node might be a proxy which will be updated once promise is resolved.
Expand Down
6 changes: 4 additions & 2 deletions web/static/assets/lib/datadom/dev/datadom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c17000

Please sign in to comment.