-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update dependencies & tweak event bus
- Loading branch information
1 parent
e8914b8
commit 1657d64
Showing
23 changed files
with
285 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file added
BIN
+17.1 KB
.yarn/cache/@storybook-addon-storysource-npm-6.5.15-ee4a90b28c-e501c78ad8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+8.58 KB
.yarn/cache/@storybook-client-logger-npm-6.5.15-b49cb58d56-cee16aea08.zip
Binary file not shown.
Binary file added
BIN
+1.59 MB
.yarn/cache/@storybook-components-npm-6.5.15-2d7d0f4f78-c405643a00.zip
Binary file not shown.
Binary file added
BIN
+8.72 KB
.yarn/cache/@storybook-core-events-npm-6.5.15-44150b3f6d-8991672093.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+48.6 KB
.yarn/cache/@storybook-source-loader-npm-6.5.15-319e7f9a57-2330d2b16f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1020 KB
.yarn/cache/react-syntax-highlighter-npm-15.5.0-da5363373b-c082b48f30.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+9.46 KB
.yarn/cache/regenerator-runtime-npm-0.13.11-90bf536060-27481628d2.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import { EventEmitter } from 'events'; | ||
import { unref } from 'vue'; | ||
|
||
class EventBus extends EventEmitter {} | ||
|
||
const busses = {}; | ||
/** | ||
* Get an event bus | ||
* @param {string} id unique id | ||
* @param {string} busId unique id | ||
* @returns {EventBus} | ||
*/ | ||
export function getBus(id) { | ||
export function getBus(busId) { | ||
const id = unref(busId); | ||
if (!(id in busses)) busses[id] = new EventBus(); | ||
return busses[id]; | ||
} | ||
/** | ||
* Remove a previously created event bus | ||
* @param {string} id unique id | ||
* @param {string} busId unique id | ||
* @returns {EventBus} | ||
*/ | ||
export function removeBus(id) { | ||
export function removeBus(busId) { | ||
const id = unref(busId); | ||
delete busses[id]; | ||
} |
Oops, something went wrong.