Skip to content

Commit

Permalink
feat(relative-time): aurelia-relativetime-signal
Browse files Browse the repository at this point in the history
the relative time binding behavior now additionally listens to the aurelia-relativetime-signal. Use this to only notify RT about changes

related issue #241
  • Loading branch information
zewa666 committed Nov 14, 2017
1 parent 05ab7a4 commit cce3b09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/article/en-US/i18n-with-aurelia.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ Now aurelia-i18n will automatically emit signals when internal changes happen an
</source-code>
</code-listing>

> If you want to only update your relative time binding behaviors, you may use the signal `aurelia-relativetime-signal` which will only trigger those and safe unnecessary update roundtrips
### Complex objects for variables
In some cases it might be useful to define variables via complex objects. Let's take a look at below example. It shows a validation message to hint the user that a given field should be in range of min and max.
Now we could easily pass min and max as separate variables but on the other hand that involves more work you'd have to do manually if the source is a object.
Expand Down
2 changes: 1 addition & 1 deletion src/rt.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class RtBindingBehavior {

bind(binding, source) {
// bind the signal behavior
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal', 'aurelia-relativetime-signal');

// rewrite the expression to use the RtValueConverter.
// pass through any args to the binding behavior to the RtValueConverter
Expand Down

0 comments on commit cce3b09

Please sign in to comment.