Skip to content

Instantly share code, notes, and snippets.

@mattbierner
Created October 6, 2013 20:28
Show Gist options
  • Save mattbierner/6858684 to your computer and use it in GitHub Desktop.
Save mattbierner/6858684 to your computer and use it in GitHub Desktop.
Atum: Transactional Try Example
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