Replace manual React Context boilerplate with a single createPocket call
Add shared state like theme or filters to a React app without writing a Provider by hand
Learn a minimal pattern for typed Context providers and hooks in TypeScript
| icydotdev/pocket | aaaa-zhen/siri-glsl | amyraxvpn-main/amyraxvpn-relay | |
|---|---|---|---|
| Stars | 36 | 36 | 35 |
| Language | HTML | HTML | HTML |
| Setup difficulty | easy | easy | easy |
| Complexity | 1/5 | 2/5 | 2/5 |
| Audience | developer | designer | general |
Figures from each repo's GitHub metadata at analysis time.
Pocket is a small TypeScript library that simplifies how developers set up shared state in React applications using React's built in Context API. Normally, wiring up a Context in React means writing several separate pieces: a context object, a Provider component, a custom hook to read the value, and a manual check that throws an error if the hook is used outside its Provider. Pocket collapses all of that into a single function call named createPocket, which returns both a typed Provider component and a matching hook in one line. The setup function passed to createPocket can call any React hooks, such as useState, useEffect, or useReducer, and whatever it returns becomes the value consumers read through the paired hook. If the setup function returns a value from useState directly, consumers can destructure it exactly the way they would with useState itself. Each place a Provider is mounted in the component tree runs its own independent setup, so multiple instances of the same context keep separate state. The setup function can also accept props passed to the Provider, giving each instance its own configuration. Naming a pocket with a string as the first argument to createPocket improves the developer experience: error messages become specific, for example warning that a consumer was called outside its named Provider, and the component shows up with a readable label in React DevTools instead of a generic name. Pocket has full TypeScript type inference from the setup function's return value, so no manual type annotations are needed. It has zero runtime dependencies and is described as a thin layer over the standard Context API, meaning it does not add extra behavior like fine grained re renders. For libraries that need more advanced state management features, the README points to Zustand or Jotai instead. Pocket is installed through npm as the package named @icydotdev/pocket.
A tiny TypeScript library that replaces React's boilerplate Context setup with one function call that returns a typed Provider and matching hook.
Mainly HTML. The stack also includes TypeScript, React, npm.
The README does not state the specific license terms, though it links to a LICENSE file in the repository.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.