{"_id":"@dgaa/use-store-subscribe","_rev":"1-27f8ab3c8bb3b4d35a6121c6590c6958","name":"@dgaa/use-store-subscribe","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@dgaa/use-store-subscribe","version":"0.0.1","description":"A simple hook to subscribe to the StoreSubject from @dgaa/store-subject","keywords":["behaviorsubject","event","observable","react","hook"],"homepage":"https://github.com/ahineya/dgaa","bugs":{"url":"https://github.com/ahineya/dgaa/issues","email":"deadswallow@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ahineya/dgaa.git"},"author":{"name":"Pavlo Yevsehnieiev","email":"deadswallow@gmail.com"},"license":"MIT","private":false,"dependencies":{"react":"18.2.0"},"peerDependencies":{"@dgaa/store-subject":"0.0.3","tslib":"2.5.3"},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"39c8cfe2a7c7daf9d15f5c8bd7c5f168a824f629","_id":"@dgaa/use-store-subscribe@0.0.1","_nodeVersion":"17.7.2","_npmVersion":"8.5.2","dist":{"integrity":"sha512-y6bwsVU0LR6X6MYGPvCPGuypZefSTKMy/vjwmJlPI/nD+YkTvbOpkDH32j7lxVAsVQzNmS6dWpmQRljFxjYm1Q==","shasum":"f27181a88801c4503832b98c69e4ae12d150c56a","tarball":"https://registry.npmjs.org/@dgaa/use-store-subscribe/-/use-store-subscribe-0.0.1.tgz","fileCount":8,"unpackedSize":2645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBC9L+LK4lLXihDOop8JuoKxYLXMgTHy2kZTbFxvzcazAiBYW8cnlgQDjT931PCiSRl6CzUDouLbay0L23IgBwIYgg=="}]},"_npmUser":{"name":"ahineya","email":"deadswallow@gmail.com"},"directories":{},"maintainers":[{"name":"ahineya","email":"deadswallow@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-store-subscribe_0.0.1_1687085628146_0.5608841593845457"},"_hasShrinkwrap":false},"0.0.4":{"name":"@dgaa/use-store-subscribe","version":"0.0.4","description":"A simple hook to subscribe to the StoreSubject from @dgaa/store-subject","keywords":["behaviorsubject","event","observable","react","hook"],"homepage":"https://github.com/ahineya/dgaa","bugs":{"url":"https://github.com/ahineya/dgaa/issues","email":"deadswallow@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ahineya/dgaa.git"},"author":{"name":"Pavlo Yevsehnieiev","email":"deadswallow@gmail.com"},"license":"MIT","private":false,"peerDependencies":{"react":">=16.0.0","react-dom":">=16.0.0","@dgaa/store-subject":"0.0.4","tslib":"2.5.3"},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"e93e9d30333df2cc89032cfae053587c5499da5b","_id":"@dgaa/use-store-subscribe@0.0.4","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-fJGpslN6K8BnmnjLM+Ri7fxk3ApF8v1mlkBYGBhzzkC5ajTc4ejvcWjhePO1QbQSGApJVVBGipfdSMboHTIwng==","shasum":"ae0a25f3090607298a6e5a6612595c6185fd27fb","tarball":"https://registry.npmjs.org/@dgaa/use-store-subscribe/-/use-store-subscribe-0.0.4.tgz","fileCount":8,"unpackedSize":3237,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa3tYvaL3GFynMwqs6fbPQtVEvANJLX3hIL6OIwdSDLAiEA+flnu2+oMuknN2KkBeglw9WyayDUH9hMAQ1/A8FyWzI="}]},"_npmUser":{"name":"ahineya","email":"deadswallow@gmail.com"},"directories":{},"maintainers":[{"name":"ahineya","email":"deadswallow@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-store-subscribe_0.0.4_1709116681190_0.8463584198605103"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-18T10:53:48.062Z","0.0.1":"2023-06-18T10:53:48.374Z","modified":"2024-02-28T10:38:01.898Z","0.0.4":"2024-02-28T10:38:01.408Z"},"maintainers":[{"name":"ahineya","email":"deadswallow@gmail.com"}],"description":"A simple hook to subscribe to the StoreSubject from @dgaa/store-subject","homepage":"https://github.com/ahineya/dgaa","keywords":["behaviorsubject","event","observable","react","hook"],"repository":{"type":"git","url":"git+https://github.com/ahineya/dgaa.git"},"author":{"name":"Pavlo Yevsehnieiev","email":"deadswallow@gmail.com"},"bugs":{"url":"https://github.com/ahineya/dgaa/issues","email":"deadswallow@gmail.com"},"license":"MIT","readme":"# use-store-subscribe\n\n## Building\n\nRun `nx build use-store-subscribe` to build the library.\n\n## Running unit tests\n\nRun `nx test use-store-subscribe` to execute the unit tests via [Jest](https://jestjs.io).\n\n## Usage\n\n```tsx\n// store.ts\n\nclass SomeStore {\n  public storeSubject = new StoreSubject(1);\n\n  public updateValue(value: number) {\n    this.storeSubject.next(value);\n  }\n}\n\nexport const someStore = new SomeStore();\n```\n\n```tsx\n\n// Component.tsx\n\nimport { useStoreSubscribe } from '@dgaa/use-store-subscribe';\nimport { someStore } from './store';\n\nconst Component = () => {\n  const currentValue = useStoreSubscribe(someStore.storeSubject);\n\n  const updateValue = () => {\n    someStore.updateValue(currentValue + 1);\n  };\n\n  return (\n    <div>\n      {currentValue}\n      <button onClick={updateValue}>Update</button>\n    </div>\n  );\n};\n\n```\n","readmeFilename":"README.md"}