Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Store.peek inside native getter

$
0
0

I’m working with a component that handles websocket updates and uses store.pushPayload when incoming websocket data arrives. I then have code in a native get() that peeks from the store and is displayed on the template:

get wifiStatus() {
    return this.store.peekRecord('wifi-status', 1);
}

This seems to re-evaluate after pushPayload and the UI updates accordingly, but I’m not really understanding why. My understanding of native getters is that they are re-evaluated when any tracked state they depend on changes. Does the Ember store in this instance have some state change after pushPayload that causes this to re-evaluate? And is doing this bad practice or is it working as expected?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles