Created
October 6, 2013 20:28
-
-
Save mattbierner/6858684 to your computer and use it in GitHub Desktop.
Atum: Transactional Try Example
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
var transactionalTryStatement = function(body, handlerId, handler, finalizer) { | |
return bind(getState, function(state) { // Get the current state. | |
return tryStatement( // Then evaluate a try statement with an exception handler that | |
body, // restores the saved state and executes the passed in handler. | |
handlerId, | |
next(setState(state), handler), | |
finalizer); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment