-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ports Drilling #812
Comments
Context API (unsafe)Solving ports drilling problem
Should print On the other hand it must not work vice versa. If If If However this API is not type-safe because context this way can only send Go solves this with type-assertions but we can't do that, our type-system is structured and messages do not carry any type-related metadata at runtime. |
|
The Problem
Classical "props drilling" problem existing in e.g. React and Go. Abstractions to solve this in both platforms called "context".
In Go, unlike React, Context also solves #813 but we are want to only talk about first problem - sharing data between nodes in a component-tree without explicit message passing.
Why Not Global API?
Also note that there is #811 that kinda solves this problem but not specifically for parent-child hierarchies, which is critical for solving ports drilling problem. Global scope allows implicit data sharing but doesn't have required constraints, e.g. it allows siblings to share data, or it allows parent to read data that child saved.
In the context API a node can only get the data that was saved at parent level and save the data at its own level for its children. Unlike Global Scope API it's uni-directional dataflow.
The text was updated successfully, but these errors were encountered: