From cce3b091c9437534aba26d7d6a8393fac4129526 Mon Sep 17 00:00:00 2001 From: Vildan Softic Date: Tue, 14 Nov 2017 19:18:28 +0100 Subject: [PATCH] feat(relative-time): aurelia-relativetime-signal the relative time binding behavior now additionally listens to the aurelia-relativetime-signal. Use this to only notify RT about changes related issue https://github.com/aurelia/i18n/issues/241 --- doc/article/en-US/i18n-with-aurelia.md | 2 ++ src/rt.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/article/en-US/i18n-with-aurelia.md b/doc/article/en-US/i18n-with-aurelia.md index e0c7db20..37b433de 100644 --- a/doc/article/en-US/i18n-with-aurelia.md +++ b/doc/article/en-US/i18n-with-aurelia.md @@ -717,6 +717,8 @@ Now aurelia-i18n will automatically emit signals when internal changes happen an +> 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. diff --git a/src/rt.js b/src/rt.js index 5b17a816..f73919d8 100644 --- a/src/rt.js +++ b/src/rt.js @@ -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