recomputepublic
On a class-based helper, it may be useful to force a recomputation of that helpers value. This is akin to rerender
on a component.
For example, this component will rerender when the currentUser
on a session service changes:
1 2 3 4 5 6 7 8 9 10 | // app/helpers/current-user-email.js export default Ember.Helper.extend({ session: Ember.inject.service(), onNewUser: Ember.observer( 'session.currentUser' , function () { this .recompute(); }), compute() { return this .get( 'session.currentUser.email' ); } }); |
Please login to continue.