{"_id":"@amarajs/plugin-redux","_rev":"2-0341c5b285520c50df6d2ba6ee865ae0","name":"@amarajs/plugin-redux","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@amarajs/plugin-redux","amdName":"AmaraRedux","version":"0.1.0","description":"Wraps Redux as AmaraJS middleware, providing store access to plugins.","jsnext:main":"src/index.js","main":"dist/amara-plugin-redux.js","umd:main":"dist/amara-plugin-redux.umd.js","scripts":{"bump":"standard-version","testonly":"mocha --compilers js:babel-register test/**/*.js","lint":"eslint src test","test":"flow && npm run lint && npm run testonly","build":"npm-run-all clean -p rollup:* -p minify:* -s size","clean":"rimraf dist && mkdirp dist","rollup:cjs":"rollup -c rollup.config.js -f cjs -n AmaraRedux src/index.js -o dist/amara-plugin-redux.js","rollup:umd":"rollup -c rollup.config.js -f umd -n AmaraRedux src/index.js -o dist/amara-plugin-redux.umd.js","minify:cjs":"uglifyjs dist/amara-plugin-redux.js -cm toplevel -o dist/amara-plugin-redux.min.js -p relative --source-map dist/amara-plugin-redux.min.js.map","minify:umd":"uglifyjs dist/amara-plugin-redux.umd.js -cm -o dist/amara-plugin-redux.umd.min.js -p relative --source-map dist/amara-plugin-redux.umd.min.js.map","size":"strip-json-comments --no-whitespace dist/amara-plugin-redux.min.js | gzip-size | pretty-bytes","release":"npm run build -s && npm run bump && git push --follow-tags origin master && npm publish"},"keywords":["amara","amarajs","core"],"authors":["Dan Barnes <amarajs.framework@gmail.com>"],"repository":{"type":"git","url":"git+https://github.com/amarajs/plugin-redux.git"},"license":"MIT","files":["src","dist"],"eslintConfig":{"parser":"babel-eslint","extends":"eslint:recommended","env":{"browser":true,"node":true,"mocha":true,"es6":true},"globals":{"expect":true},"rules":{"no-cond-assign":0}},"devDependencies":{"babel-core":"^6.9.1","babel-eslint":"^7.1.1","babel-plugin-transform-flow-strip-types":"^6.21.0","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.9.0","chai":"^3.5.0","eslint":"^3.13.1","flow-bin":"^0.38.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^3.2.0","npm-run-all":"^2.1.1","pretty-bytes-cli":"^2.0.0","rimraf":"^2.5.2","rollup":"^0.41.4","rollup-plugin-buble":"^0.15.0","rollup-plugin-flow":"^1.1.1","sinon":"^1.17.4","sinon-chai":"^2.8.0","standard-version":"^4.0.0","strip-json-comments-cli":"^1.0.1","uglify-js":"^2.6.2"},"gitHead":"6ea95528cbc8ec707ad4adda3ed2c3d22b0188a3","bugs":{"url":"https://github.com/amarajs/plugin-redux/issues"},"homepage":"https://github.com/amarajs/plugin-redux#readme","_id":"@amarajs/plugin-redux@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"},"dist":{"integrity":"sha512-sw8XbkGDmSsKi8CYePuK1OLzGOQjoDMeIM7cBbeeppEcAwyR+hWAzYSR0WSKX+HyhUnI/qdAtLZHU39eHrTQng==","shasum":"9656369233c1618a8cdffe70dfe87ed3fb85d3da","tarball":"https://registry.npmjs.org/@amarajs/plugin-redux/-/plugin-redux-0.1.0.tgz","fileCount":10,"unpackedSize":14484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDGYBviAsBdBv0PQdhjpdp3vIYXbKuHw9hQ0JGld/RYAiEA28m02PcgKpXepp0IPwK+C5VZ0VgnOy6ZtEw/9HZ1tAs="}]},"maintainers":[{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-redux_0.1.0_1522618272662_0.86398942026065"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-01T21:31:12.606Z","0.1.0":"2018-04-01T21:31:12.770Z","modified":"2022-04-04T13:43:43.481Z"},"maintainers":[{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"}],"description":"Wraps Redux as AmaraJS middleware, providing store access to plugins.","homepage":"https://github.com/amarajs/plugin-redux#readme","keywords":["amara","amarajs","core"],"repository":{"type":"git","url":"git+https://github.com/amarajs/plugin-redux.git"},"bugs":{"url":"https://github.com/amarajs/plugin-redux/issues"},"license":"MIT","readme":"## @amarajs/plugin-redux\n\nPlugin middleware for AmaraJS to connect features to a Redux store.\n\nActions dispatched to your `Amara` instance (e.g. through features using the `@amarajs/plugin-events` middleware) will also be dispatched to your Redux store. A new boolean property, `__Amara__`, will be added to any actions dispatched to your store through Amara. Your Redux middleware, reducers, sagas, etc. can look for this property to know if the action was dispatched through this middleware.\n\n### Installation\n\n`npm install --save @amarajs/plugin-redux`\n\n### Usage\n\n```javascript\nimport Amara from '@amarajs/core';\nimport AmaraRedux from '@amarajs/plugin-redux';\nimport myStore from './store';\nconst amara = new Amara([\n    AmaraRedux(myStore)\n]);\n```\n\n### Feature Type\n\nThe `@amarajs/plugin-redux` middleware does not handle any feature types.\n\n### New `args` Property\n\nThis plugin adds a `'state'` property to `args` functions. Whenever your Redux store state changes, AmaraJS will re-evaluate any features whose `args` functions reference the `'state'` property.\n\n```javascript\namara.add({\n    type: 'dom',\n    targets: ['main'],\n    args: {\n        // this selector will be re-invoked every\n        // time your Redux store's state changes\n        loading: ({state}) => state.loading\n    },\n    // this method will be re-invoked every time\n    // the value of state.loading changes\n    apply: ({loading}) => loading && 'please wait...' || 'ready!';\n});\n```\n\n### Customization\n\nThis plugin accepts a single argument, which should be a Redux store.\n\n### Contributing\n\nIf you have a feature request, please create a new issue so the community can discuss it.\n\nIf you find a defect, please submit a bug report that includes a working link to reproduce the problem (for example, using [jsBin](https://jsbin.com)). Of course, pull requests to fix open issues are always welcome!\n\n### License\n\nThe MIT License (MIT)\n\nCopyright (c) Dan Barnes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md"}