Created
June 25, 2018 08:28
-
-
Save nguyen-thom/c532c4758137dae9073ea16ddb1c8327 to your computer and use it in GitHub Desktop.
js_example_function
This file contains hidden or 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
connect.socketLocker = function() { | |
this.isRunning = false; | |
this.run = function(action) { | |
if (this.isRunning) return; | |
this.isRunning = true; | |
action(() => { | |
this.isRunning = false; | |
}); | |
}; | |
}; | |
//use it | |
lockerMessage.run((callback) => { | |
connectPlus.messageService.newMessageTrigger(userId, callback); | |
}); | |
lockerBotHandleUserList.run((callback) => { | |
connectPlus.messageService.botHandleTrigger(callback); | |
}); | |
lockerWaitingAgentUserList.run((callback) => { | |
connectPlus.messageService.waitingHandleTrigger(callback); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment