diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-19 18:08:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-19 18:08:39 +0300 |
commit | e1f8f12bbed19bea753d81d7586b30ea403733d5 (patch) | |
tree | 379d8f092fa416eb1830c2a8208380e438441b72 /app/assets/javascripts/helpers/event_hub_factory.js | |
parent | 235dc61f473cb7f02a9453a59fb26d293e05b092 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/helpers/event_hub_factory.js')
-rw-r--r-- | app/assets/javascripts/helpers/event_hub_factory.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/helpers/event_hub_factory.js b/app/assets/javascripts/helpers/event_hub_factory.js index 4d7f7550a94..08cfe40b52d 100644 --- a/app/assets/javascripts/helpers/event_hub_factory.js +++ b/app/assets/javascripts/helpers/event_hub_factory.js @@ -3,6 +3,8 @@ import mitt from 'mitt'; export default () => { const emitter = mitt(); + const originalEmit = emitter.emit; + emitter.once = (event, handler) => { const wrappedHandler = evt => { handler(evt); @@ -11,6 +13,10 @@ export default () => { emitter.on(event, wrappedHandler); }; + emitter.emit = (event, args = []) => { + originalEmit(event, args); + }; + emitter.$on = emitter.on; emitter.$once = emitter.once; emitter.$off = emitter.off; |