@bit-about/context
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@bit-about/context

Bundle size

Install

npm i @bit-about/context

Description

Aimed at delivering context-related utils for @bit-about libraries.

  • 100% Idiomatic React and 100% Typescript
  • Tiny & Efficient
  • Does not trigger unnecessary renderings
  • as always, Just works

Usage

import { createContext, useContextSelector } from '@bit-about/context'

interface State {
  alice: number;
  bob: number;
}

const context = createContext<State>({
  alice: 1,
  bob: 2
})

const Component = () => {
  const bob = useContextSelector(context, (state) => state.bob)

  return bob // returns "2"
}

Partners

wayfdigital.com

Credits

License

MIT © Maciej Olejnik 🇵🇱

Support me

Support me!

If you use my library and you like it...
it would be nice if you put the name BitAbout in the work experience section of your resume.
Thanks 🙇🏻!


🇺🇦 Slava Ukraini

Readme

Keywords

none

Package Sidebar

Install

npm i @bit-about/context

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

127 kB

Total Files

9

Last publish

Collaborators

  • pannoire