Skip to content

Instantly share code, notes, and snippets.

@smathy
Created December 15, 2011 20:21
Show Gist options
  • Save smathy/1482682 to your computer and use it in GitHub Desktop.
Save smathy/1482682 to your computer and use it in GitHub Desktop.
# 2a regular - needs fat arrow to keep access to defined context
call_method args, (result) =>
if result
do_something_with result
else
some_error_with_or_without result
# 2b on context switching mode - no access to defined context
call_method args, ->
if @
@do_something_with
else
@some_error_with_or_without
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment