{"_id":"@anwitars/reactive-state","_rev":"1-480fd8dbec08ef097fd6a7fac36c7722","name":"@anwitars/reactive-state","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@anwitars/reactive-state","version":"1.0.0","keywords":["react","typescript","npm-package"],"author":{"name":"anwitars"},"license":"MIT","_id":"@anwitars/reactive-state@1.0.0","maintainers":[{"name":"anwitars","email":"maksa22242@gmail.com"}],"homepage":"https://github.com/anwitars/react-reactive-state#readme","bugs":{"url":"https://github.com/anwitars/react-reactive-state/issues"},"dist":{"shasum":"f3da3f682083a84972c70ed32d15fb229e00563d","tarball":"https://registry.npmjs.org/@anwitars/reactive-state/-/reactive-state-1.0.0.tgz","fileCount":10,"integrity":"sha512-s/5vg7kT9aYKqsKpY/ElHnr+ND8VFfbHSiMlTZ52BdQF4devHGZosJ85B9zGQPgxWw14PiJr80tf14BgUH2w+g==","signatures":[{"sig":"MEUCIFlSvUAAnxzO8HrUpEbk/sQpEMP4id+rWLuxkBvywTmtAiEAg6Z4p3maigFSMYGeSn4TNh3Vt3/+6G1N7vV4xg50aQQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anwitars%2freactive-state@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9326},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"b1bf950bdf0bc829f5e01b9d285b8f2288f2797c","scripts":{"test":"jest","build":"npm run build:cjs && npm run build:esm","build:cjs":"esbuild src/index.ts --bundle --minify --sourcemap --outfile=dist/index.cjs.js --format=cjs","build:esm":"esbuild src/index.ts --bundle --minify --sourcemap --outfile=dist/index.esm.js --format=esm"},"_npmUser":{"name":"anwitars","email":"maksa22242@gmail.com"},"repository":{"url":"git+https://github.com/anwitars/react-reactive-state.git","type":"git"},"_npmVersion":"10.8.2","description":"Simple wrapper to easily manage multiple useStates in a component.","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","react":"^18.3.1","esbuild":"^0.24.0","ts-jest":"^29.2.5","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/react":"^18.3.9","@testing-library/react":"^16.0.1","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"react":">=17.0.2 <19"},"_npmOperationalInternal":{"tmp":"tmp/reactive-state_1.0.0_1727272729142_0.42806705321248906","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@anwitars/reactive-state","version":"1.0.1","description":"Simple wrapper to easily manage multiple useStates in a component.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"npm run build:cjs && npm run build:esm","build:cjs":"esbuild src/index.ts --bundle --minify --sourcemap --outfile=dist/index.cjs.js --format=cjs","build:esm":"esbuild src/index.ts --bundle --minify --sourcemap --outfile=dist/index.esm.js --format=esm","test":"jest"},"keywords":["react","typescript","npm-package"],"repository":{"type":"git","url":"git+https://github.com/anwitars/react-reactive-state.git"},"author":{"name":"anwitars"},"license":"MIT","peerDependencies":{"react":">=17.0.2 <19"},"devDependencies":{"@testing-library/react":"^16.0.1","@types/jest":"^29.5.13","@types/react":"^18.3.9","esbuild":"^0.24.0","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","react":"^18.3.1","ts-jest":"^29.2.5","typescript":"^5.6.2"},"_id":"@anwitars/reactive-state@1.0.1","gitHead":"afd3a4731e6689fb78c7bf4344a8ff0d994f443b","bugs":{"url":"https://github.com/anwitars/react-reactive-state/issues"},"homepage":"https://github.com/anwitars/react-reactive-state#readme","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-7YMjLYAWnnKot5g+/X5paa9KBeI7esMzR6uueLJyblpG+YPiAsqSmFov5TQIIYieQ2KS3ecNbVPvn+g5rHhw1g==","shasum":"5bdcde45f45a749655b58c0ecee99fdb6ec8f94e","tarball":"https://registry.npmjs.org/@anwitars/reactive-state/-/reactive-state-1.0.1.tgz","fileCount":10,"unpackedSize":9450,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anwitars%2freactive-state@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB21/FbUX1L5oV8itNlveLBymWuDN5VgiAOE+3YA5NJYAiEAxgM8wXqaUoUzHg9HstGE/vekNm/Dvp9j/BykxUuREgs="}]},"_npmUser":{"name":"anwitars","email":"maksa22242@gmail.com"},"directories":{},"maintainers":[{"name":"anwitars","email":"maksa22242@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reactive-state_1.0.1_1727361260438_0.07247267339711838"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-25T13:58:49.057Z","modified":"2024-09-26T14:34:21.033Z","1.0.0":"2024-09-25T13:58:49.423Z","1.0.1":"2024-09-26T14:34:20.591Z"},"bugs":{"url":"https://github.com/anwitars/react-reactive-state/issues"},"author":{"name":"anwitars"},"license":"MIT","homepage":"https://github.com/anwitars/react-reactive-state#readme","keywords":["react","typescript","npm-package"],"repository":{"type":"git","url":"git+https://github.com/anwitars/react-reactive-state.git"},"description":"Simple wrapper to easily manage multiple useStates in a component.","maintainers":[{"name":"anwitars","email":"maksa22242@gmail.com"}],"readme":"# Reactive State\n\nSmall React library to easily manage more complex state in your components without using Reducers.\n\n## Example\n\n```jsx\nimport React from 'react';\nimport { useReactiveState } from 'reactive-state';\n\nconst toSnakeCase = (str) => str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n\nconst YourComponent = () => {\n    const state = useReactiveState({\n        username: \"\",\n        password: \"\",\n        rememberMe: false\n        // more state here...\n    });\n\n    const submit = async () => {\n        const payload = Object.keys(state.getValues()).reduce((acc, key) => {\n            acc[toSnakeCase(key)] = state[key];\n            return acc;\n        }, {});\n\n        const response = await fetch('https://your-api.com/login', {\n            method: 'POST',\n            body: JSON.stringify(payload)\n        });\n        // ...\n    }\n\n    return (\n        <div>\n            <input\n                type=\"text\"\n                value={state.username}\n                onChange={(e) => state.setUsername(e.target.value)}\n            />\n            <input\n                type=\"password\"\n                value={state.password}\n                onChange={(e) => state.setPassword(e.target.value)}\n            />\n            <input\n                type=\"checkbox\"\n                checked={state.rememberMe}\n                onChange={(e) => state.setRememberMe(e.target.checked)}\n            />\n        </div>\n    );\n}\n```\n\n","readmeFilename":"README.md"}