Skip to content

Instantly share code, notes, and snippets.

@lukegalea
Created September 15, 2014 12:57
Show Gist options
  • Save lukegalea/0ad4f5d3d1a9d85c4f7f to your computer and use it in GitHub Desktop.
Save lukegalea/0ad4f5d3d1a9d85c4f7f to your computer and use it in GitHub Desktop.
Need for "soft" get in ember-data
_reloadScoreStats: ->
if @get('isMarkedOrReviewedForm')
@get('membership').then (m) ->
# TODO: Replace with public API when it becomes available
# This will only reload if it's already loaded
stat = m._data.membershipStat
if stat and stat.get('isLoaded')
stat.reload()
# @get('membership.membershipStat') would result in a load if it hadn't already been loaded
# The use of _data is to avoid the get triggering that load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment