Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orisomething/why-context
Examples for context usage
https://github.com/orisomething/why-context
context ember react vue
Last synced: 23 days ago
JSON representation
Examples for context usage
- Host: GitHub
- URL: https://github.com/orisomething/why-context
- Owner: oriSomething
- License: mit
- Created: 2021-04-08T19:01:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-06T14:08:45.000Z (over 3 years ago)
- Last Synced: 2024-10-16T08:43:55.895Z (2 months ago)
- Topics: context, ember, react, vue
- Language: JavaScript
- Homepage:
- Size: 384 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Why context
This repository contains some case studies for why context (in React sense) is useful.
`React.createContext()` can be achieved on Vue by `provide()` and `inject()` hooks, it can also emulated in old versions of Ember (`2.x`) via `Component#parentView`, but sadly not in Ember `3.x` with `GlimmerComponent`.I’ve created this repository to show why `React.createContext()` is not just a dumb dependecy injection mechanism and using providers through the tree is actually useful for lots of cases. (And also to show why Ember should re-introduce the options to use this pattern).
## Good reasons to use context
1. [Keyboard management](keyboard-management/README.md)
2. Theming
3. Dynamic router
4. Deeplinks
5. [Contextual state](contextual-state/README.md)
6. Emulating CSS’s cascade for alternative styling system