Reputation: 53
First off I think that the subject question may not contain the correct context in what I am looking for, but I will try to explain myself.
I am fairly new to Ember, and I am looking for a way to take a property and refresh the value of it, periodically instead of based on the view refreshing, action, or a template element causing the property to change.
This is kind of a generic example, but it closely relates to what I am doing:
I store the value of that calculation in a property and use it in a "service" and other places throughout the app.
any suggestions?
Upvotes: 2
Views: 657
Reputation: 2474
This is one of the ways that Ember Octane is just javascript. You can use setInterval and calculate the value at whatever interval you like then set it to a @tracked property on the service. Whenever your interval function updates the property it will be changed anywhere you've displayed it.
Upvotes: 3