3 ms·
If you want to know what comes next from fb as far as Flux goes, dig into Relay. It's actually really important to build flexibility into the data types. The mo
by JaRail 11y ago
If you want to know what comes next from fb as far as Flux goes, dig into Relay. It's actually really important to build flexibility into the data types. The model of a user changes but a year-old app should still be able to query and understand the results.
That also goes for old components. When you have thousands of components, how do you update the model? Well, you avoid strict typing and look to query languages instead. Rather than every component sharing a type, each component internally defines what it needs.
Move to the dispatcher, the data fired off by actions needs to fit the stores that are listening. A common type requires everything to be completely in sync. I think it's worth considering how a query language could fit here, such that a listener can query the payload for what it needs from a message. A flexible object/JSON blob are a reasonable way to pass messages with an eye for that in the future.
I look at the messages to be the start to a distributed application architecture. So I can have messages that target remote services. Eg "turn on living room lights". And similarly, messages from the server, "living room lights are now on." It's a nice way of tying local APIs and remote services together. Have them all communicate with the same messages.