Created
September 15, 2014 12:57
-
-
Save lukegalea/0ad4f5d3d1a9d85c4f7f to your computer and use it in GitHub Desktop.
Need for "soft" get in ember-data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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