Skip to content

Commit

Permalink
feat(almin): Support Transaction Events
Browse files Browse the repository at this point in the history
fix #2 #1
  • Loading branch information
azu committed Aug 11, 2017
1 parent 2a070f3 commit 33c52dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"homepage": "https://github.com/almin/almin-devtools",
"devDependencies": {
"almin": "^0.11.0",
"almin": "^0.13.0",
"babel-cli": "^6.23.0",
"babel-preset-jsdoc-to-assert": "^4.0.0",
"babel-preset-latest": "^6.22.0",
Expand Down
7 changes: 7 additions & 0 deletions src/almin-devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const contextToDevTools = (alminContext, devTools) => {
alminContext.onChange(() => {
sendDispatched()
});
alminContext.events.onBeginTransaction((payload, meta) => {
devTools.send(`Transaction Begin:${meta.transaction.name}`, alminContext.getState())
});
alminContext.events.onEndTransaction((payload, meta) => {
devTools.send(`Transaction End:${meta.transaction.name}`, alminContext.getState())
});

alminContext.events.onDidExecuteEachUseCase(() => {
sendDispatched();
});
Expand Down
27 changes: 12 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ ajv@^4.9.1:
co "^4.6.0"
json-stable-stringify "^1.0.1"

almin@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/almin/-/almin-0.11.0.tgz#4bf913559b53cbc685875115bada70a718422f85"
almin@^0.13.0:
version "0.13.11"
resolved "https://registry.yarnpkg.com/almin/-/almin-0.13.11.tgz#953c6efa380d4a9245c3ed05bf8fa4826363635e"
dependencies:
lru-map-like "^1.1.2"
map-like "^1.1.0"
object-assign "^4.1.0"
map-like "^2.0.0"
shallow-equal-object "^1.0.1"

ansi-regex@^2.0.0:
version "2.1.1"
Expand Down Expand Up @@ -1374,15 +1373,9 @@ lru-cache@^4.0.1:
pseudomap "^1.0.2"
yallist "^2.1.2"

lru-map-like@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/lru-map-like/-/lru-map-like-1.1.2.tgz#80fa80c512cbfdd2c2d8c5506d82c28439faa666"
dependencies:
map-like "^1.0.3"

map-like@^1.0.3, map-like@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/map-like/-/map-like-1.1.3.tgz#6faaca5339e0cc6567a3a55dd281fd871a39e5da"
map-like@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/map-like/-/map-like-2.0.0.tgz#94496d49ad333c0dc3234b27adbbd1e8535953b4"

micromatch@^2.1.5:
version "2.3.11"
Expand Down Expand Up @@ -1818,6 +1811,10 @@ set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"

shallow-equal-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/shallow-equal-object/-/shallow-equal-object-1.0.1.tgz#a402410fb4b7c15370ec7e78701e9280f1c1d1e4"

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
Expand Down

0 comments on commit 33c52dd

Please sign in to comment.