Skip to content

Instantly share code, notes, and snippets.

@smaugho
Created April 29, 2017 14:12
Show Gist options
  • Save smaugho/771f598553fef6dc14a5d781f8c28b7e to your computer and use it in GitHub Desktop.
Save smaugho/771f598553fef6dc14a5d781f8c28b7e to your computer and use it in GitHub Desktop.
Sugar Syntax with Actions
$PutModel(user).withProgress("Saving user...")
.onFailed().toast("An error occurred");
$PutModel(user).always().code("checkState();")
.onDone().toast("User was saved")
.onFailed().toast("An error occurred");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment