Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-global-hook

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-global-hook - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

5

package.json
{
"name": "create-global-hook",
"version": "0.0.1",
"version": "0.1.0",
"description": "Takes an aribtrary React hook and makes it globally stateful",
"main": "index.js",
"main": "build/create-global-hook.js",
"types": "build/create-global-hook.d.ts",
"repository": "https://github.com/garbles/create-global-hook",

@@ -7,0 +8,0 @@ "author": "Gabe Scholz <hi@gabe.pizza>",

11

README.md

@@ -10,3 +10,5 @@ Takes an aribtrary React hook and makes it globally stateful.

const [hook, Provider] = createHook((value: number) => React.useState(value));
const [hook, Provider] = createGlobalHook((value: number) =>
React.useState(value)
);

@@ -19,5 +21,12 @@ const App = () => {

const OtherApp = () => {
const [state, setState] = hook();
// same state here
};
ReactDOM.render(
<Provider value={0}>
<App />
<OtherApp />
</Provider>,

@@ -24,0 +33,0 @@ document.getElementById("root")

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc