initial commit
This commit is contained in:
1
node_modules/jibo/lib/behaviors/base/succeed-on-event.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/succeed-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.status=n.IN_PROGRESS,!0},stop:function(){this.getEmitter().removeListener(this.event,this.onEventBind)},_onEvent:function(){this.onEvent.apply(null,arguments),this.status=n.SUCCEEDED},update:function(t){return this.status===n.SUCCEEDED?n.SUCCEEDED:t}}),t.addBehavior(module);
|
||||
Reference in New Issue
Block a user