Hi folks,
It is a real shame, but I still didn't find time to do UI node development in Flexdash. But should get started with it soon...
@tve has written a nice article about state mirroring in Flexdash. This is very important for me, because I can't count anymore the number of development issues I had due to message resending in the old AngularJs dashboard. So if Flexdash is able to reduce the headache for UI node developers, that would be very welcome.
I have a few questions about the article:
-
There is an example provided of how a state cache looks like in Flexdash:
Although this is internal Flexdash kitchen, it always helps me to develop if I know how stuff works.
Does this mean that Flexdash maintains two states:
- The current state
- The new state
And that it calculates the delta as soon as the state is updated via the API, so that the delta can be send to the frontend. And then the old state is immediately automatically removed? Or does it keep - for some reason - multiple states?
-
The API currently already has some nice functions to deal with arrays, since that is being used a lot of course in Node-RED messages. But I find one example a bit cryptic to read:
That is for me code where I need to add some comments, because afterwards I have forgotten how it works...
I know that you can't add all array handling functions to your API, but wouldn't it be more simple if you provided a
setAtIndex(name, value)
or aset(name, value, index)
? That kind of "convenience functions" in the API would really support my old brain -
Sorry if I have overlooked it, but how do user interactions in your frontend widget update the state in the cache? Do we need to wire the output messages to the input again, to update the state? But that is perhaps a bit of traffic overhead, because you send the same state to the frontend which is already at the frontend. On the other hand if you N clients open, they of course all need to have a state update in their frontend. Please illuminate me...
-
Are there any other functions you had planned to add to the API in the future? Because it could be that you had other things in mind, but had no time for it. If so, it would be really usefull if there would be a short API description in the documentation. Where we can easily find the functions and their parameters/return value. So that you can add there comments like "planned", "to be discussed" or whatever information that can help us while developing. And yes I know that it currently will be a small list, but you never know somebody can convince you to add some more functions afterwards
Thanks for all the time you spend on - beside your developments - to teach our community!!!
Bart