Formatters that only run when the triggering value changes

Today, we have these great formatters to display values/string in a different way. However, these formatters seems to constantly (re)run even if the base value/string has not changed.

For example, if you create a custom formatter that simply console logs and returns you can see if just keeps running.

dmx.Formatter('string', 'tester', function (str) {
    console.log('formatter run');
    return str;
});

Screen Shot 2021-09-13 at 11.36.17 AM

No big deal until there are dozens/hundreds of more complicated formatters running on a page.

Is it possible for the formatter to only run once when it is initialized and not run again until the dynamic data using the formatter changes, or is updated?

Community Page
Last updated: