Make polling play nice with promises
This commit is contained in:
parent
f8390b8f82
commit
b27977baaa
|
@ -25,9 +25,15 @@ mixin = Ember.Mixin.create
|
|||
@stopPollingModel(key)
|
||||
|
||||
pollModel: (property) ->
|
||||
model = @get(property)
|
||||
addToPolling = (model) =>
|
||||
@get('polling').startPolling(model)
|
||||
|
||||
@get('polling').startPolling(model)
|
||||
if model = @get(property)
|
||||
if model.then
|
||||
model.then (resolved) ->
|
||||
addToPolling(resolved)
|
||||
else
|
||||
addToPolling(model)
|
||||
|
||||
stopPollingModel: (property) ->
|
||||
model = @get(property)
|
||||
|
|
Loading…
Reference in New Issue
Block a user