Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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