@corpuscule/context

v0.12.0
DOM-dependent context for Corpuscule

🛠 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

Latest Stable Version Package size

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:
    • Package size
    • Package size
  • 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:

npm i @corpuscule/[email protected]

Metadata

  • MIT
  • Whatever
  • Vlad Rindevich
  • released 4/7/2019

Downloads

Maintainers