Yes, you can use CableReady’s
set_dataset_property operation to update the mapping object dynamically. As the README explains, it means you can provide users with a UI to set up their own custom mappings for your app, and update them in real-time thanks to StimulusReflex Nothing Morphs and CableReady.
It’s been a while since I built this, man - I suggest that you try out the code locally and experiment with the console log to satisfy your curiousity.
My quick read of the code is that the 3rd party library did not want to be
unbinded if it’s not already set up, so I could use
bindingsValueChanged to establish an initial value that would be ready when
connect ran. And later, if the value does change, all mappings are unbound before the mappings are updated and new bindings are created. Still, memory is fuzzy and that could be only part of the story. The important part is that having an event fire in between
connect is something that might allow you to design your solution far more efficiently than others might realize is possible - and that is a productivity arbitrage for you.
Seriously, though: me explaining it is like, 1/5th as good as actually trying it out yourself. As you build more and more Stimulus controllers, this sort of thing comes up just often enough to be annoying and having this technique in your pocket is like knowing how to use a flint and steel if you’re stranded in the woods.