Created
February 1, 2016 22:28
-
-
Save emarthinsen/3f3567a6a05fd2f578ba to your computer and use it in GitHub Desktop.
Long-lived Plugin
This file contains 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
var interval = null; | |
var onStart = function(context) { | |
[coscript setShouldKeepAround:true]; | |
interval = [coscript scheduleWithInterval:1.0 jsFunction:function() { | |
log("In interval"); | |
}]; | |
}; | |
var onStop = function(context) { | |
if(interval) { | |
[interval cancel]; | |
log("Interval canceled"); | |
} else { | |
log("No interval to cancel"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment