I am playing on typescript decorators. I played with angular also and I came across on property bindings.
The framework that I develop has a very similar need.
Imagine this structure:
RootComponent has RootState,
GameplayComponent has GameplayState.
RootState has property serverData(more accurate serverData.winAmount).
GameplayState has property winAmount.
The components communicate across notification protocol and the RootComponent instance communicates with the server and record the data in its state.
So I need when serverData changes, the gameplay.state.winAmount changed. The idea is decoupling of course. I know I can write more complex RootState that can notify another object which can serialize. But it is more complex.
Can I achieve this with reflect-metadata and decorators?
I tried but I really do not understand how is that possible. Also I know its super strongly individual but I stuck... Thanks!
Aucun commentaire:
Enregistrer un commentaire