0.0.9 ā€¢ Published 2 years ago

way-provider v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Way-Provider ā†Æ

Context Provider for webcomponents

ā› No more prop drilling in webcomponents

Docs at way-provider-docs.vercel.app

šŸ“ Props:
  • context: object
  • all: boolean

Step 1:

import 'way-provider';

<way-provider context="{'name': 'consumer'}">
  ...children components
</way-provider>

Step 2:

import { attachWayContext } from 'way-provider';

...
connectedCallback(){
  attachWayContext(this)
}
  thisCmp = get_current_component()

  onMount(() => attachWayContext(thisCmp))

Step 3:

  this.getAttribute('name');
  @property()
  name: string
  export let name

This library is not using default customElement decorator so don't worry if it's imported multiple times, the way-provider will not throw an error and will be defined just once.


Built using Lit and Vite

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago