{"_id":"@aspirity/grapes","_rev":"5-83d12c37d67d01ba4eefb5434f6bf826","name":"@aspirity/grapes","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@aspirity/grapes","version":"0.0.1","description":"Granular global state hook for react","main":"dist/cjs/grapes.js","module":"dist/esm/grapes.js","types":"dist/dts/grapes.js","scripts":{"prebuild":"rimraf ./dist","build":"node ./build.js","test":"echo \"Error: no test specified\" && exit 1","lint":"eslint --ext .js,.jsx,.ts,.tsx --format=pretty ./"},"repository":{"type":"git","url":"git+https://github.com/aspirity-ru/grapes.git"},"keywords":[],"author":{"name":"Denis Zavershinskiy"},"license":"MIT","bugs":{"url":"https://github.com/aspirity-ru/grapes/issues"},"homepage":"https://github.com/aspirity-ru/grapes#readme","devDependencies":{"@types/react":"17.0.13","@typescript-eslint/eslint-plugin":"4.28.2","esbuild":"0.12.15","eslint":"7.30.0","eslint-config-airbnb-typescript":"12.3.1","eslint-config-prettier":"8.3.0","eslint-formatter-pretty":"4.1.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","eslint-plugin-react-hooks":"4.2.0","prettier":"2.3.2","rimraf":"3.0.2","tiny-glob":"0.2.9","typescript":"4.3.5"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"gitHead":"4d7c230b5fdcf05ded44f1a41b1820510e5da372","_id":"@aspirity/grapes@0.0.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-LwuEHChsdqxncv76iTJHcv25X4AaqaCgLMkisUnUJKFEQ4+bAWjh1Si/y1XretLDqEVtSuBZuF76kwvE2E2ncA==","shasum":"4a6766c5394d8c64d6c16541683668bc75f58f7b","tarball":"https://registry.npmjs.org/@aspirity/grapes/-/grapes-0.0.1.tgz","fileCount":48,"unpackedSize":59168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5YWXCRA9TVsSAnZWagAAO24P/RFYVas5EBd37edY7Nn6\nVoa1tG+nQgnW6fzbPc/Gx661Y18zLvljZmzHcj5srgSwYEgbC5rUJZyYaEdM\nkc9CqVmtfFDWB4xJRHSM1Bl0IhTdiLY2B4C9gjOu1TDE0eIvqe0Wl/SRoXi6\nqIDFr5TumzeiJ0aDn1DZCoevFASZiPYhKDpKTUed2GhVt1qAmYk+wSPpQJfP\nMnP3pldxS3/a9Fc2NogZnZuBagT/pdfuQTjuJ9BqtgEA76YzWNylUphNiksT\n16QlVqNI1dpc2lcW9KK20JtHbccOeJDNLCGsm5oy6GLZ2Lin2bF4UWOnBIKa\nTWUwkk1JcTzxPsIT7MQsplJu0MvwD3dhvxqWL0lG3tlmW4P8dW0bzDd2EQlB\nmW2RTx5+b5CXBujdkRzI49AeJUfPA38KImKJeGXMkQC9wXRIn7fZL13KX6yk\ne3/2bcAVS4h5RHR6wyowFzU5SoTrSVcHOT5h3EpJMmJ47hRQLih4AqptHQB4\nOlSrLPOBMyeESTDKaTH+3YtLPATatVoUCymkyyQq+1AJi7s+M2kQh7EdKZIk\nt5G1L80Ki7ovIL9ekKOvrEtJKq+ySBrrpXaTq3hEuVukquxX31BsSCIVDyuD\n0SVTircrGHiWwheMs+2Wj1ZduutdINDtODczbtT1pjnCTvlINm2vCGlaSkdJ\noukc\r\n=Wx46\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiGAJGnlPr6kSw0ib0ogB5ttz8k0MAFgkPs8Z0bX+yNAiBJAQS//w/9Tm7hMkXLtZk/4Q2dvVYOZyONNV8NaU+9Gw=="}]},"_npmUser":{"name":"aspirity-npm","email":"registration@aspirity.com"},"directories":{},"maintainers":[{"name":"aspirity-npm","email":"registration@aspirity.com"},{"name":"zaverden","email":"zaverden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grapes_0.0.1_1625654679036_0.38622382295948676"},"_hasShrinkwrap":false},"0.1.0":{"name":"@aspirity/grapes","version":"0.1.0","description":"Granular global state hook for react","main":"dist/cjs/grapes.js","module":"dist/esm/grapes.js","types":"dist/dts/grapes.js","scripts":{"prebuild":"rimraf ./dist","build":"node ./build.js","test":"echo \"Error: no test specified\" && exit 1","lint":"eslint --ext .js,.jsx,.ts,.tsx --format=pretty ./"},"repository":{"type":"git","url":"git+https://github.com/aspirity-ru/grapes.git"},"keywords":["react","hooks","state"],"author":{"name":"Denis Zavershinskiy"},"license":"MIT","bugs":{"url":"https://github.com/aspirity-ru/grapes/issues"},"homepage":"https://github.com/aspirity-ru/grapes#readme","devDependencies":{"@types/react":"17.0.13","@typescript-eslint/eslint-plugin":"4.28.2","esbuild":"0.12.15","eslint":"7.30.0","eslint-config-airbnb-typescript":"12.3.1","eslint-config-prettier":"8.3.0","eslint-formatter-pretty":"4.1.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","eslint-plugin-react-hooks":"4.2.0","prettier":"2.3.2","rimraf":"3.0.2","tiny-glob":"0.2.9","typescript":"4.3.5"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"gitHead":"e84d2feb2cfb096de0b125efde8d546a7f9fa20a","_id":"@aspirity/grapes@0.1.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-l8Q8AnysqkjI9YtpPZAdg3qJDTmuOsjjbX6y/kLnvyIQyAZsjll0OHZc+J0Z8hsgLjBaKK9bgjE33UhWTOvEug==","shasum":"91cc9fe76b3cdb9c33503879bc4c3c6d4be86f30","tarball":"https://registry.npmjs.org/@aspirity/grapes/-/grapes-0.1.0.tgz","fileCount":49,"unpackedSize":61226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5ZZrCRA9TVsSAnZWagAARDgP+QBMrNvf6RTA4ngUZLU6\n8XJgj+SAjrGEVDT4S1dup1W8a+hpd53DyZIKWeoUvYJJGw/NnuBeQjAdknD1\nalRWr6Laqsvh1CMLTUP6EcVilQZ37tRaqzJMbPLtwN2xcBRTEHJUWt/CXRFR\nto9eA/cvG1KBlygNmug80wWZAhirxz4ZmZ2Aid9VCjRbR0RdP7ojJrflo9sG\nCbfB+Q1/HSLQCTd6BK9QJq7RCMAJf5WRk4avsXJ3kE8LvgrpYzhy/rqJizzL\nbf9GIodDBiNe2lUIAPRDwkoRrPppXaK2owQWor2Nex1gIN8BsF6vtTjC8Yxe\nfPFP3khu9V9rbUu+FbK/3I3qMwgGhpwm2AKfi7i8oRLgX4s8X5+iyAzVn+wW\nN9bdfFZN76xVMwhCDcCSlUfaXjQY258mL7a+VcMj2vGXZ+lloeCYd1nShWOh\njZidW25nkITXSkq3ns55O41Tg5GJzXq8zk4XyPWDM14LfrkUlCpxSOxWHKpn\neklQyi1SptsJ30aOIcPba54GJKlu9dkPVNjshMvckR9k91rE51KRnsIHFuMJ\nxgQYhc4YtGbLv+3sGt7lfxpdWJ1DNNWRDwD5n6hbfxQL1YAVSyroEwnfTI9X\nexIwwurE+VInr3bTekveHhLuAe1//j+4ihc9CPX8tRtpFzL8VGQqBhjUSgIv\n6LV8\r\n=5d2B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKP64EzEOW84helM09Pa3SYnrQLrADj0pqk/HgIPdPpQIhANeYql1I4WkWw9zBh0r5A/BZ63sihmgH6V61PP1CEYpx"}]},"_npmUser":{"name":"zaverden","email":"zaverden@gmail.com"},"directories":{},"maintainers":[{"name":"aspirity-npm","email":"registration@aspirity.com"},{"name":"zaverden","email":"zaverden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grapes_0.1.0_1625658987018_0.27016784105364056"},"_hasShrinkwrap":false},"0.1.1":{"name":"@aspirity/grapes","version":"0.1.1","description":"Granular global state hook for react","main":"dist/cjs/grapes.js","module":"dist/esm/grapes.js","types":"dist/dts/grapes.js","scripts":{"prebuild":"rimraf ./dist","build":"node ./build.js","test":"jest","lint":"eslint --ext .js,.jsx,.ts,.tsx --format=pretty ./"},"repository":{"type":"git","url":"git+https://github.com/aspirity-ru/grapes.git"},"keywords":["react","hooks","state"],"author":{"name":"Denis Zavershinskiy"},"license":"MIT","bugs":{"url":"https://github.com/aspirity-ru/grapes/issues"},"homepage":"https://github.com/aspirity-ru/grapes#readme","devDependencies":{"@testing-library/react-hooks":"7.0.1","@types/jest":"26.0.24","@types/react":"17.0.13","@typescript-eslint/eslint-plugin":"4.28.2","esbuild":"0.12.15","esbuild-jest":"0.5.0","eslint":"7.30.0","eslint-config-airbnb-typescript":"12.3.1","eslint-config-prettier":"8.3.0","eslint-formatter-pretty":"4.1.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","eslint-plugin-react-hooks":"4.2.0","jest":"27.0.6","prettier":"2.3.2","react":"^16.9.0 || ^17 || ^18","react-test-renderer":"17.0.2","rimraf":"3.0.2","tiny-glob":"0.2.9","typescript":"4.3.5"},"peerDependencies":{"react":"^16.9.0 || ^17 || ^18"},"gitHead":"15990cdf4f04dcebffbd1de63691c9b3b35aacff","_id":"@aspirity/grapes@0.1.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-sF9oz+pKSlbX1yfYbuP8feJ9ISUFA+ji6gkYQ6XHH/h8SDh3KpoDkGXSCZIpmznpRlroFf8P4Dst48WyTuHgDw==","shasum":"6c6436f29060389eafa76f4c41ddce3987b5384d","tarball":"https://registry.npmjs.org/@aspirity/grapes/-/grapes-0.1.1.tgz","fileCount":62,"unpackedSize":95698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGjbDCRA9TVsSAnZWagAARE4P/j88jyon09e8Jaf9Nm3S\nA1+30s0NL7MQnrjzr5ICvWoZcje07p9GssuuR5Ehn3GoM+T3r1dZ+wDfjAWm\ntek6dSKQ/JlXmiQ7QYHhLm70Q6gp93MeUrICqFrFdqdGz06krTGLFRkfpWHN\nmuxQ46kbo1kCm2vI3g8i850l6yoEBLL7Lw0SzrR7tahPt5mf3A2uGhUiZs1w\nRmmoltLvs7kuIHooc755v/bwYBM3owiG4OSbAKZg5cZ+PoS5ca4/mW8NzScV\nfmTj8xdCFr5Qsdhea7SkPfTL2U6l0ee1ScoC+5cp54zXjLTsr846O85BGjp1\ndavAxfaLiwQSYCx6YqEnHDM1TTh9sa8FHtUp/2vWnFxE93bV5vt2zCA4yWme\n9f9VDXbmzb8H2MqZuffyxIKfUmQMse3wbDmouATWFzs2Ywwzx0r8dDttLfFC\nw1BroowxZeyQ1oibzHHsGwFp2tUQ/kC5qmD0tdYQ+Fkg3r7t6otQhyPNrqX2\n2pYionA+V6An6VYzMcyJRUZDAi1PJpJwV8yXgKkovxoDa1DYxy2f5uN5kTtl\nXb4wrZhhx/aTf0NhXUe02wADZQJl+d/o1mQI397bpnRWXuKg9FLJ3LTgVo1y\nqhrG0LyNKHcvV0AWnWUwxnAY0dUFxOQL0NnkGJ8d5TJcvJ+0/9dbmfp1SFYf\nWR91\r\n=12KG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvPhybWFipRztoOcUdoatMVBMkZ3fxOkhDEw5Opj+AzAIhAJR25H2hgyo6/UVKo4hAbceHwOYjHAJht15JCdWew9c/"}]},"_npmUser":{"name":"zaverden","email":"zaverden@gmail.com"},"directories":{},"maintainers":[{"name":"aspirity-npm","email":"registration@aspirity.com"},{"name":"zaverden","email":"zaverden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grapes_0.1.1_1629107907813_0.8796793826024525"},"_hasShrinkwrap":false},"0.1.2":{"name":"@aspirity/grapes","version":"0.1.2","description":"Granular global state hook for react","main":"dist/cjs/grapes.js","module":"dist/esm/grapes.js","types":"dist/dts/grapes.js","scripts":{"prebuild":"rimraf ./dist","build":"node ./build.js","test":"jest","lint":"eslint --ext .js,.jsx,.ts,.tsx --format=pretty ./"},"repository":{"type":"git","url":"git+https://github.com/aspirity-ru/grapes.git"},"keywords":["react","hooks","state"],"author":{"name":"Denis Zavershinskiy"},"license":"MIT","bugs":{"url":"https://github.com/aspirity-ru/grapes/issues"},"homepage":"https://github.com/aspirity-ru/grapes#readme","devDependencies":{"@testing-library/react-hooks":"7.0.1","@types/jest":"26.0.24","@types/react":"17.0.13","@typescript-eslint/eslint-plugin":"4.28.2","esbuild":"0.12.15","esbuild-jest":"0.5.0","eslint":"7.30.0","eslint-config-airbnb-typescript":"12.3.1","eslint-config-prettier":"8.3.0","eslint-formatter-pretty":"4.1.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","eslint-plugin-react-hooks":"4.2.0","jest":"27.0.6","prettier":"2.3.2","react":"^16.9.0 || ^17 || ^18","react-test-renderer":"17.0.2","rimraf":"3.0.2","tiny-glob":"0.2.9","typescript":"4.3.5"},"peerDependencies":{"react":"^16.9.0 || ^17 || ^18"},"gitHead":"435e2a8136e92a52604f2d03a8d67d1cd9a3fbd3","_id":"@aspirity/grapes@0.1.2","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-nZ9cqX6czjiiive66gti7X5SBeVQI++V7W7fmdXS0jldoLndQbUngAMzFeGkUBCXFK/Hp46VeDYJBQlh2swk7A==","shasum":"f3606691ec63979b8f19b5281c957126ccd6096e","tarball":"https://registry.npmjs.org/@aspirity/grapes/-/grapes-0.1.2.tgz","fileCount":54,"unpackedSize":94948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGj/PCRA9TVsSAnZWagAAL/IP/3nDtCCJHeWBMjo8v5Vv\ndgb7D2BwkW7boaUxF1Xc5f7Dr1QG8V6qXbv8dvxtQPMBl0CkEaqqVRfWMXvN\nnR1UbQg2d8lBNVvEPPI29eoTmUQD7sp0N+ex4ncTr4PJCHrJEnO29PUD8tY7\nwrG3q4rka6Xu+iG44PDO1e9pXDUg0wTPvWFlWZvw7RucDJAV7Zy5WdSdawCO\nRS7bXgArln4FgA+DCF2xtQJJRMLcjim9/uNpf26aikMh2b7AUnqDyQ74QKTb\nGfORqKPjYhyiN+H1blW1ulXrYhXs9/Dp/8xvQvgEZalNI8qR7IQfB2Xel2Oc\nXp7cmrz20RN5yL4D3gcOXf/l2eMNC/9u9FWqRcurvRZMXGsoK/IS0NcEX/gH\nTaWLlpJciVm0HyWipCsZNB/snWCTM2gW5E3spqudH+DmE0UvMYoDufe+HDqE\nInMRW/+WQiNSfQs1PB67qg1/cqCP9+JLfYl2ia/DeZrrZkWCDcVgp4GScckO\nUrnFxQ9D/D0IrULTAuMMWZaNpTf5UK1mcx7YWXY1/Dyl6y1XhG3yxI2ePkYs\njRRpBDAoMRkzmTkheQGJGOX05X48H64jG1Ta1F1pmi7lYkBpy3srdVuKwxDH\n8lq+CUEjhdppZUA4cWwAWFswevlIbZjNnZbdrw6gvbWMLnqcjOCGhqD7tPDY\nVHlZ\r\n=hCGN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5CDuSfdvNiplSYZyPupGKnZkQrDdX517NhEyScCmSvgIgM0BQqHbuR7wRZxcsc3GarcHEClETOCI4Iz7g50rVFCA="}]},"_npmUser":{"name":"zaverden","email":"zaverden@gmail.com"},"directories":{},"maintainers":[{"name":"aspirity-npm","email":"registration@aspirity.com"},{"name":"zaverden","email":"zaverden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grapes_0.1.2_1629110223647_0.29316962809224933"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-07T10:44:38.789Z","0.0.1":"2021-07-07T10:44:39.239Z","modified":"2023-08-28T11:21:23.506Z","0.1.0":"2021-07-07T11:56:27.159Z","0.1.1":"2021-08-16T09:58:27.939Z","0.1.2":"2021-08-16T10:37:03.796Z"},"maintainers":[{"email":"mvolkov@aspirity.com","name":"mvolkov"},{"email":"registration@aspirity.com","name":"aspirity-npm"},{"email":"zaverden@gmail.com","name":"zaverden"}],"description":"Granular global state hook for react","homepage":"https://github.com/aspirity-ru/grapes#readme","keywords":["react","hooks","state"],"repository":{"type":"git","url":"git+https://github.com/aspirity-ru/grapes.git"},"author":{"name":"Denis Zavershinskiy"},"bugs":{"url":"https://github.com/aspirity-ru/grapes/issues"},"license":"MIT","readme":"# Grapes\n[![Version](https://img.shields.io/npm/v/@aspirity/grapes.svg?style=flat-square&)](https://www.npmjs.com/package/@aspirity/grapes?activeTab=versions)\n[![Last commit](https://img.shields.io/github/last-commit/aspirity-ru/grapes.svg?style=flat-square&)](https://github.com/aspirity-ru/grapes/graphs/commit-activity)\n[![License](https://img.shields.io/github/license/aspirity-ru/grapes.svg?style=flat-square&)](https://github.com/aspirity-ru/grapes/blob/main/LICENSE)\n\n> Granular global state hook for react\n\n## Installation\n\n```bash\nnpm install @aspirity/grapes\n```\n\n## Usage\n\n[Demo on sandbox](https://codesandbox.io/s/grapes-state-y1dee?file=/src/App.tsx)\n\n```typescript\n// in countGrape.ts\nimport { createGrape } from \"@aspirity/grapes\";\nexport const countGrape = createGrape<number>(\"count\");\n\n// in Counter.tsx\nimport { useGrape } from \"@aspirity/grapes\";\nimport { countGrape } from \"./countGrape\";\n\nexport function Counter() {\n  const [count, setCount] = useGrape(countGrape, 1);\n  const increment = () => {\n    setCount(count + 1);\n  };\n  return (\n    <button onClick={increment}>\n      Click to increment\n    </button>\n  );\n}\n\n// in CounterViewer.tsx\nimport { useGrape } from \"@aspirity/grapes\";\nimport { countGrape } from \"./countGrape\";\n\nexport function CounterViewer() {\n  const [count] = useGrape(countGrape, 1);\n  return (\n    <div>\n      Clicked {count} times\n    </div>\n  );\n}\n```\n\n## Using with `Provider`\n\nYou can use `grapes` without any setup setup code. `useGrapes` will use default store.\nBut in some cases you may want to pre-configure store on app start, or for testing.\nIn this case you can create the bunch instance and provide it via `GrapesBunchProvider`.\nWith this scenario you are able to set a custom cleanup timeout.\n\n```typescript\nimport { createGrapesBunch, GrapesBunchProvider } from \"@aspirity/grapes\";\n//...\n\nconst myBunch = createGrapesBunch({ cleanupTimeoutMs: 10_000 });\nmyBunch.set(someGrape, new Date())\n//...\n\n<GrapesBunchProvider value={myBunch}>\n  //...\n</GrapesBunchProvider>\n\n```\n","readmeFilename":"readme.md"}