{"_id":"@bobfp/yeet-lens","_rev":"1-2e295f55705540c8953af0396ce140b8","name":"@bobfp/yeet-lens","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bobfp/yeet-lens","version":"1.0.0","main":"lib/index.js","jsnext:main":"es/index.js","module":"es/index.js","license":"MIT","scripts":{"compile:commonjs":"better-npm-run compile:commonjs","compile:umdmin":"uglifyjs dist/yeet-lens.js -mt -o dist/yeet-lens.min.js","compile:umd":"better-npm-run compile:umd","compile:es":"babel -d es/ src/","compile":"npm run compile:commonjs && npm run compile:umd && npm run compile:umdmin && npm run compile:es","prepublish":"npm run compile","test":"jest"},"dependencies":{},"peerDependencies":{},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.4.5","@babel/plugin-proposal-object-rest-spread":"^7.5.5","@babel/plugin-transform-arrow-functions":"^7.0.0","@babel/plugin-transform-block-scoping":"^7.0.0","@babel/plugin-transform-computed-properties":"^7.2.0","@babel/plugin-transform-destructuring":"^7.5.0","@babel/plugin-transform-function-name":"^7.0.0","@babel/plugin-transform-modules-commonjs":"^7.0.0","@babel/plugin-transform-modules-umd":"^7.0.0","@babel/plugin-transform-parameters":"^7.0.0","@babel/plugin-transform-shorthand-properties":"^7.0.0","@babel/plugin-transform-spread":"^7.0.0","@babel/plugin-transform-template-literals":"^7.0.0","babel-core":"^7.0.0-bridge.0","babel-jest":"^23.4.2","babel-upgrade":"^1.0.1","better-npm-run":"^0.1.1","jest":"^24.8.0","mkdirp":"^0.5.1","uglify-js":"^3.6.0"},"betterScripts":{"test":{"command":"jest","env":{"NODE_ENV":"test"}},"compile:commonjs":{"command":"babel -d lib/ src/","env":{"NODE_ENV":"commonjs"}},"compile:umd":{"command":"mkdirp dist/ && babel -o dist/yeet-lens.js src/","env":{"NODE_ENV":"umd"}}},"gitHead":"406b75fdf34365a78e0166ebd528ce913731865f","description":"Yeet is a fast, boilerplate-free, state management library for JavaScript applications.","_id":"@bobfp/yeet-lens@1.0.0","_nodeVersion":"11.15.0","_npmVersion":"6.10.1","dist":{"integrity":"sha512-kM7HCTGvpySDhBkwSiBjQ0EDHMRShatglV3tVZ8GSe42/hq2E28ZmpPnJ+Os8GPCwzYq6gcARk89BS09HZWjhA==","shasum":"c2f776cb846bde9362a3c9b0d6185c7e76975c05","tarball":"https://registry.npmjs.org/@bobfp/yeet-lens/-/yeet-lens-1.0.0.tgz","fileCount":7,"unpackedSize":17689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQ4pCCRA9TVsSAnZWagAAhXUP/juO37KQnJug0a+qWQM3\n1nlp5EYXORQDqIXhajsH+p54zWxscPHDEyeLoOJi/pgADPqmduohNOTv325e\nWiuiUhaWdB10MOPF0KRZwZYBAHYz57vr4eR4Zk0qsD508Y7phMkfCVgDs5so\nO5Uu9ymFiMibhbMqtIErnTdwOFOVHNN0ovYZdd2t5QYfuDmOll3aNYRPWHNV\nrecYH9vay4xxQV+Jd+EQnA76HmG3eobeWfn/Q94lwMYUAPhfWiKTLk1gdmfI\nDTh6GcxdIy5bpcxmTX7Ej5f4K5qyIAfVOOvEfNC60li0NwPNYhStUpOwfJ/n\nz3GoNBQwdQX1UZYb/thK+Lkj30MK9SNsq1dwzlDauvaMEFOXCjm8fVdwG06X\nZclRRjh3WjO2dlpd7PhgN5m2yXTtzPEoJfuueBmmnMIuWB/oOTescQQOlZTO\n8e2+FOTV6s0xHZMm7JyVoSGWh9OT1GHP8VjaUCwpnbkC3gA5KRb4wqsu6y5R\naS4y3PLFJmjB60DzbLTJIB+3Ym4Pedgx0qGgqvNGapWWd2gRd6VcVT94IXgg\n/zIf6Ghdc7LnSXeKIi7vY0v5mKfagRPveIiGX2q+y0vkilxn18vxAGeavu6g\nYK2ZWKOEtY58dsZFwXdFNSrMmDCEDCdaqhsWZ3T079gVQ/XX9eObjeJMf3e0\n/rwr\r\n=eSKM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkzIftinqq5VIFhMJOEj2XZ4IbKuYyi7oOxYS/JKnn8AiAJVa4shi5SD1AD6Lfl3ro7spZC9OeKmBd4rvnujACAbQ=="}]},"maintainers":[{"name":"bobfp","email":"bcoop713+bobfp@gmail.com"}],"_npmUser":{"name":"bobfp","email":"bcoop713+bobfp@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yeet-lens_1.0.0_1564707393732_0.5882565875177292"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-02T00:56:33.537Z","1.0.0":"2019-08-02T00:56:33.870Z","modified":"2022-04-04T19:55:22.721Z"},"maintainers":[{"name":"bobfp","email":"bcoop713+bobfp@gmail.com"}],"description":"Yeet is a fast, boilerplate-free, state management library for JavaScript applications.","license":"MIT","readme":"# Yeet\n\nYeet is a fast, boilerplate-free, state management library for JavaScript applications.\n\nIt is also:\n\n * Dependency-Free\n\n * Tiny (1.3KB)\n\n * Easy To Learn\n\n\n## Why use Yeet?\n\nRedux is a fantastic library, but it isn't ideal for every application. The amount of boilerplate makes smaller application tedious to develop.\n\nWith the advent of the React Hooks API, larger apps are starting to move away from a \"pure global state\" model to a more hybrid, nuanced approach where developers might find redux to be overkill.\n\nYeet is designed for these use cases -- to fill in the gaps in applications that strive for a happy medium between pure component state and pure global state.  \n\n## Basic Concepts\n\nYeet is based around creating functions that read from a global store, and write to the global store.\n\nIn order to improve performance, and partition state data, the store is composed of one or more \"atoms\", which are just simple JavaScript objects. When a subscription is created, it's not to the entire store, but to a specific atom.\n\nLikewise, when the store is written to, the function is only applied to the state inside the specified atom.\n\n## Using Yeet\n\n`yarn add @bobfp/yeet-state`\n\nYou will probably want to use the [React Bindings](https://github.com/bobfp/yeet-react) to interact with a yeet store, but here is a quick example of the low-level API\n\n```js\nimport {createStore} from 'yeet-state';\n\nconst user = {\n  name: 'Bob', \n  type: 'Meat Popsicle',\n  age: 32\n}\n\nconst counter = {value: 0}\n\n// createStore returns a store, with atoms corresponding \n// to the keys of the supplied object.\nconst store = createStore({user, counter});\n\nconsole.log(store.getAtom('user').age)\n// 32\n\nstore.subscribe('user')(user => console.log(user.age))\n\nstore.publish('user')(user => {...user, age: user.age + 1})\n// 33\n```\n","readmeFilename":"README.md"}