Value Converter update problems with arrays


I have a repeat.for loop on an array of object, and I filter this array with anotherArray in a custom value converter.
When the otherArray changes, my view is not refreshed. I tried to use signalBindings to explicitly trigger the refresh of the view but it does not seem to work that way.
Am I expecting things that are not supposed to work? Is there another way to do this?

Here the gist to reproduce my problem :

Thank you,

the problem is that your array is not changing, (items are being added to it - but the array reference doesn’t change).
I don’t know why the custom signal is not working.
and I’m pretty sure this code use to work (I’m not sure in what version of what package).
I’ve recently also had breaking changes in my app regarding changes in array that are not reflected properly, and I came up with a easy fix.
in your binding, add the length of the array as a parameter, that way - when the length changes - the binding will reevaluate.

  <div repeat.for="item of array | customArrayFilter:otherArray:otherArray.length">
    <span>${} : ${item.value}</span>
1 Like

It seems that the declaration of the signals inside the value-converter doesn’t work like I did it, or has not to be done like this anymore?
I fixed it using the signal binding behavior directly in my view like :

 <div repeat.for="item of array | customArrayFilter:otherArray & signal:'custom-signal-changed'">
  <span>${} : ${item.value}</span>

In your example, you were not assigning value to signals, but declaring type for it

change to signals = ['custom-..']

Probably you were using typescript, and did the same thing ?