Optional usage without context
See original GitHub issueI have been wondering why dependence on context is not optional.
Context is always referred to as an unstable and experimental feature, although react and redux are stable libraries widely used in production.
It seems to me that passing a configured store
explicitly to connect is no harder than passing action creators to it. This would also mean that we don’t need a <Provider />
component, therefore less api surface area.
Would this update be desired? Or am I missing something and there are hidden complications i’m not considering?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Uses for Optional - java - Stack Overflow
The main design goal of Optional is to provide a means for a function returning a value to indicate the absence of a...
Read more >Java 8 Optional Usage and Best Practices - DZone
According to the Oracle documentation, an Optional is a container object that may or may not contain a non-null value.
Read more >Optionals : are bad practices still bad practices if everyone ...
Optional is primarily intended for use as a method return type where there is a clear need to represent "no result," and where...
Read more >Java Optional Is Not So Obvious - Level Up Coding
Optional is primarily intended for use as a method return type where there is a clear need to represent “no result,” and where...
Read more >Working With Java 8 Optionals - Random Thoughts on Coding
Rather for this post, we are going to cover how to use the Optional type without resorting to directly accessing the value contained...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh duh, that’s right. We’ve already got this! 😄
@everdimension : yeah, there’s an FAQ entry that addresses that: http://redux.js.org/docs/faq/StoreSetup.html#store-setup-multiple-stores . Basically, accessing the store via context acts as a lightweight dependency injection mechanism, thus making it easier to test components, less hassle passing the store down, component reuse, etc.