mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[binder] add extension that binds to a specific emitter
This commit is contained in:
parent
1598d46ea6
commit
cc65d8958c
2 changed files with 15 additions and 0 deletions
12
src/utils/binder_for.js
Normal file
12
src/utils/binder_for.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { Binder } from './';
|
||||||
|
|
||||||
|
export default class BinderFor extends Binder {
|
||||||
|
constructor(emitter) {
|
||||||
|
super();
|
||||||
|
this.emitter = emitter;
|
||||||
|
}
|
||||||
|
|
||||||
|
on(...args) {
|
||||||
|
super.on(this.emitter, ...args);
|
||||||
|
}
|
||||||
|
}
|
3
src/utils/index.js
Normal file
3
src/utils/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export Binder from './binder';
|
||||||
|
export BinderFor from './binder_for';
|
||||||
|
export fromRoot from './fromRoot';
|
Loading…
Add table
Add a link
Reference in a new issue