initial commit
This commit is contained in:
1
node_modules/jibo/lib/behaviors/start-on-event.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/start-on-event.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../bt/factory"),e=require("../bt/base"),n=e.Status,i=e.createDecorator;module.exports=i({constructor:function(t,e){this.event=t,this.onEvent=e,this.onEventBind=this._onEvent.bind(this)},start:function(){return this.getEmitter().once(this.event,this.onEventBind),this.didStart=!1,n.WAIT},_onEvent:function(){this.onEvent.apply(null,arguments),this.didStart=!0},stop:function(){this.getEmitter().removeListener(this.event,this.onEventBind)},update:function(t){return this.didStart?t:n.WAIT}}),t.addBehavior(module);
|
||||
Reference in New Issue
Block a user