Skip to content

Instantly share code, notes, and snippets.

@treygriffith
Created November 11, 2014 02:51
Show Gist options
  • Select an option

  • Save treygriffith/4b4383f6fd86b739bead to your computer and use it in GitHub Desktop.

Select an option

Save treygriffith/4b4383f6fd86b739bead to your computer and use it in GitHub Desktop.

Revisions

  1. treygriffith created this gist Nov 11, 2014.
    7 changes: 7 additions & 0 deletions sample_async_belongsto_save.js.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    comment = @store.createRecord('comment', {
    author: @get('currentUser')
    # snip
    })
    comment.get('author').then ->
    # comment.author is now resolved, safe to save
    comment.save()