@corpuscule/context
v0.14.2
Published
DOM-dependent context for Corpuscule
Downloads
33
Readme
🛠 Status: In Development
This package is currently under heavy development. Feedback is always welcome, but be careful with using it in production. API is not ready yet and can receive large changes.
@corpuscule/context
A lightweight set of decorators for creating DOM-dependent context for web components.
Context is an approach to share some data for all components in a some DOM tree branch. It creates a local state that is accessible from any component on any nesting level without direct forwarding properties through the whole chain of children.
It was invented and popularized by React.
This package also uses approach to implement context for web components suggested by Justin Fagnani in his talk.
Features
- Zero third-party dependencies. Package still contains Corpuscule dependencies, but no third-party library is used.
- Framework agnostic. You can use package with any Web Components compatible framework/library.
- Small. According to Bundlephobia, it has following sizes:
- Typed. Typescript typings are included.
Installation
$ npm install --save @corupuscule/context
or
$ yarn add @corupuscule/context
Documentation
API documentation is available for the following modules: