Skip to content

Commit

Permalink
v0.1.6 - okTurtles.events/once returns handler for use with /off
Browse files Browse the repository at this point in the history
  • Loading branch information
taoeffect committed Nov 15, 2023
1 parent 9a76894 commit 4765da1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

#### 0.1.6

- `okTurtles.events/once` now returns the callback it actually registers so that you can use it with `okTurtles.events/off`

#### 0.1.5

- SBP 2.2.0 package listed as peerDep
Expand Down
1 change: 1 addition & 0 deletions dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var _default = (0, _sbp.default)('sbp/selectors/register', {
};

(0, _sbp.default)('okTurtles.events/on', event, cbWithOff);
return cbWithOff;
},
'okTurtles.events/emit': function (event) {
for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
Expand Down
1 change: 1 addition & 0 deletions dist/module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default (sbp('sbp/selectors/register', {
sbp('okTurtles.events/off', event, cbWithOff)
}
sbp('okTurtles.events/on', event, cbWithOff)
return cbWithOff
},
'okTurtles.events/emit': function (event, ...data) {
for (const listener of sbp('okTurtles.data/get', listenKey(event)) || []) {
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default (sbp('sbp/selectors/register', {
sbp('okTurtles.events/off', event, cbWithOff)
}
sbp('okTurtles.events/on', event, cbWithOff)
return cbWithOff
},
'okTurtles.events/emit': function (event: string, ...data: any) {
for (const listener of sbp('okTurtles.data/get', listenKey(event)) || []) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sbp/okturtles.events",
"version": "0.1.5",
"version": "0.1.6",
"description": "Event handling for SBP",
"main": "dist/main.cjs",
"type": "module",
Expand Down

0 comments on commit 4765da1

Please sign in to comment.