{"_id":"@alexseitsinger/react-toggled-component","_rev":"2-b3f53131dea13be4454d7ca2ffc5f578","name":"@alexseitsinger/react-toggled-component","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@alexseitsinger/react-toggled-component","version":"0.1.0","description":"Returns a connected component that renders another component based on the state","main":"dist/main.js","homepage":"https://www.alexseitsinger.com/packages/node/react-toggled-component","author":{"name":"Alex Seitsinger","email":"software@alexseitsinger.com","url":"https://www.alexseitsinger.com"},"contributors":[{"name":"Alex Seitsinger","email":"software@alexseitsinger.com","url":"https://www.alexseitsinger.com"}],"license":"BSD-2-Clause","repository":{"type":"git","url":"https://github.com/alexseitsinger/react-toggled-component.git"},"bugs":{"url":"https://github.com/alexseitsinger/react-toggled-component/issues"},"keywords":["react","redux","toggled","component"],"devDependencies":{"@babel/core":"7.4.0","@babel/plugin-transform-runtime":"7.4.3","@babel/preset-env":"7.4.2","@babel/preset-react":"7.0.0","babel-core":"7.0.0-bridge.0","babel-jest":"24.5.0","babel-loader":"8.0.5","enzyme":"3.9.0","enzyme-adapter-react-16":"1.11.2","jest":"24.5.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"7.0.3","redux":"4.0.1","webpack":"4.29.6","webpack-cli":"3.3.0","webpack-node-externals":"1.7.2"},"dependencies":{"@babel/runtime-corejs3":"7.4.3","core-js":"3.0.1"},"peerDependencies":{"react":"^16.8.6"},"scripts":{"build":"./node_modules/.bin/webpack","test":"./node_modules/.bin/jest test"},"licenseText":"Copyright 2019 Alex Seitsinger\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","_id":"@alexseitsinger/react-toggled-component@0.1.0","dist":{"shasum":"7f4687667b3b65350c685eca44b6706b2868295a","integrity":"sha512-24mmlXIO/ac8P1SO6S3bMJWr62ovxA4k+SD9/ocU5s2brUJ01XiP12TBKKUd4hr0WlfubWDQ2i0gDzmWFKZvHA==","tarball":"https://registry.npmjs.org/@alexseitsinger/react-toggled-component/-/react-toggled-component-0.1.0.tgz","fileCount":7,"unpackedSize":119924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8zQZCRA9TVsSAnZWagAAUeEP+wdtY6slxPngDAdV/fqW\n8a7qn9M/fIFqf5f4diVWHWhfRX7sb0h0TkY+VKX4ZQSDh3DD2NJSIrsKCDl4\nO7A2fdugMBGSNbVhuAWIbrgW+rmpKPQoPKb3hTeN68q3UJSTeIZ3vQt/olQl\nZuUSZ9TdR5+MZ4Vep/OebQrJN3kbpR9zxf01FpR3nNZLFDwBgkF3WnENkdWy\nMV94/PiQB26jIiKZbvNFPrScNu/MqGgkelEHiuYpobkAgoNQx68Fcu8AWagk\nrNtcAM3QIfXDSPgmu+erMHOYtUulWXCqnAIXV5UDUOgSQ6VyuKynwckloIW3\nzRApcvu2O9taWQtcAgzWx7s3NowktPBOfCCgo8TmnJiqRYSrF1RGwFW2lE2l\n77aolhlC33GWe1k1omYTjto5gP5JWjDBDak3QQcPt19BkEe712GqJMxgNuE1\nFotCxmpCwxZWYfgshwTxxRXCWkTarj0s/PzL7X4rkbFiiRmhfizlQ6l79WR5\n5vUX4wAMU+3RhcO2odZFuY+dfPSEil6IuB8zvedNYdQFdhL5w3ktBLtGWxHF\n/tUvCPz+ZKyU83zXPOLyEzfEko4qLJhSQPHAVuZUrK5SDzFTF4hnEB3rjeDD\nGZE3V+89fC9k3D4N3IFbWWpyWL6jsxPBIcKT/p4ejuaEPKaDXNPTpDjYmf4u\nrZ56\r\n=tM53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGJKHlyA0/y7ygV3dYWQwnLIHaJ37Nn0TryFCGoR/iXAiEAwHIdxWzskXbrh8zSEqPE9T/A56dC1Y0oAbuoWVrE0nA="}]},"maintainers":[{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"}],"_npmUser":{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-toggled-component_0.1.0_1559442456931_0.4939037963227586"},"_hasShrinkwrap":false},"1.0.0":{"name":"@alexseitsinger/react-toggled-component","version":"1.0.0","description":"Returns a connected component that renders another component based on the state","main":"dist/main.js","homepage":"https://www.alexseitsinger.com/packages/node/react-toggled-component","author":{"name":"Alex Seitsinger","email":"software@alexseitsinger.com","url":"https://www.alexseitsinger.com"},"license":"BSD-2-Clause","repository":{"type":"git","url":"https://github.com/alexseitsinger/react-toggled-component.git"},"bugs":{"url":"https://github.com/alexseitsinger/react-toggled-component/issues"},"keywords":["react","redux","toggled","component"],"devDependencies":{"@babel/core":"7.4.0","@babel/plugin-transform-runtime":"7.4.3","@babel/preset-env":"7.4.2","@babel/preset-react":"7.0.0","babel-core":"7.0.0-bridge.0","babel-jest":"24.5.0","babel-loader":"8.0.5","enzyme":"3.9.0","enzyme-adapter-react-16":"1.11.2","jest":"24.5.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"7.0.3","redux":"4.0.1","webpack":"4.29.6","webpack-cli":"3.3.0","webpack-node-externals":"1.7.2"},"dependencies":{"@babel/runtime-corejs3":"7.4.3","core-js":"3.0.1"},"peerDependencies":{"react":"^16.8.6"},"scripts":{"build":"./node_modules/.bin/webpack","test":"./node_modules/.bin/jest test"},"licenseText":"Copyright 2019 Alex Seitsinger\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","_id":"@alexseitsinger/react-toggled-component@1.0.0","dist":{"shasum":"b82382fc320e9f4b78370b4378fedd6244cc5310","integrity":"sha512-ofJQvVjC7u2d+PAn99Kbyqm7pM85qE92uWdzsmRtqfTMt3BhECs2g1l076oOnSa9gmRWArzoJVNZdMznWJJg6g==","tarball":"https://registry.npmjs.org/@alexseitsinger/react-toggled-component/-/react-toggled-component-1.0.0.tgz","fileCount":7,"unpackedSize":129682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdElwwCRA9TVsSAnZWagAAma0P/iHvwwogsSbN3+jgtWMf\nD7RAt2VLruVhewUGjDqZW0HSx71TWqYUl47eMeYPmnG4YCcR8HjXZHdPG1hj\n3uzb5DQLPb4ALzoB0mlDYJEkZzmXZznLhqLt9Iz9Ij5uMN/q5l9WHC4PqaNm\nQqQDOUGFd76hv1+jo6w+dEAa7hU+8w/ZZzyiMxHi/VPBmW0mpW1HtkONa2H9\nVVqZOBu9NqNvmMefAhA6YKuhpJiSz8QXxT07aDK+ylMuvIOSUSzPpg66vJwS\n2JBW/FvbgXgYvsg+EP1Zd3nwazoU0T4BhEgzru5Wry6Ag8MeB1USB6JG+yZD\nv7R9GU6m+0fgWkkg6pjG9rZPxNrnDDoCd/E0WlNuqqwMugzzcrYR5BRwzZk7\nNCBP59KcEm9WYKPPsvg7WbVy/72AZCT8CUx+7P2eI3OaYMF3PK2Kbs/t8ggZ\nU01IigbZdWe1uqVyAr12e58r312FZdYenNA+90EeNr2hm2SJDR1K2cr3C2ih\n3ex5h8cbnm/ps/Hpn/0fWnvMjfjllBfReRAq9UFMflf/+qIfpa3Xjb/t4ZmP\noqcbJrxptiECPOoeiFLa+oqqfhDXW2YophzDrJSXYcjfivhkULnAXBCIe1GO\nr+oSimszzLy4GqdY2usS6YYHW14/xLHkOAZnH5J3yCeIuT28GAsbBu84gRfG\nw7oU\r\n=eo8l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEl+T2REhhBIZJVJlfgE7ujBnfvQ2mLGjOinvxX34HhZAiAv6PUf2R6cUVYk29JuKmeOKf6XchU8GgthbyrMjcikDA=="}]},"maintainers":[{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"}],"_npmUser":{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-toggled-component_1.0.0_1561484335436_0.6958096178998949"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-02T02:27:36.900Z","0.1.0":"2019-06-02T02:27:37.115Z","modified":"2022-04-04T12:41:40.805Z","1.0.0":"2019-06-25T17:38:55.597Z"},"maintainers":[{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"}],"description":"Returns a connected component that renders another component based on the state","homepage":"https://www.alexseitsinger.com/packages/node/react-toggled-component","keywords":["react","redux","toggled","component"],"repository":{"type":"git","url":"https://github.com/alexseitsinger/react-toggled-component.git"},"author":{"name":"Alex Seitsinger","email":"software@alexseitsinger.com","url":"https://www.alexseitsinger.com"},"bugs":{"url":"https://github.com/alexseitsinger/react-toggled-component/issues"},"license":"BSD-2-Clause","readme":"<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### Table of Contents\n\n-   [createToggledComponent][1]\n    -   [Parameters][2]\n    -   [Examples][3]\n\n## createToggledComponent\n\nReturns a connected component that renders another component based on the\nstate.\n\n### Parameters\n\n-   `$0` **[Object][4]** \n    -   `$0.components.Anonymous`  \n    -   `$0.components.Authenticated`  \n    -   `$0.state`  \n    -   `$0.connect`  \n-   `components` **[Object][4]** The Anonymous and Authenticated components to use for rendering.\n-   `state` **[Object][4]** The path to the reducer state key we want to check for truthiness.\n-   `connect` **[Function][5]** The connect function to use for connecting to redux.\n\n### Examples\n\n```javascript\nimport React from \"react\"\nimport { Provider, connect } from \"react-redux\"\nimport { Router, Route } from \"react-router\"\nimport { createToggledComponent } from \"@alexseitsinger/react-toggled-component\"\n\nimport HomePage from \"./pages/home\"\nimport LandingPage from \"./pages/landing\"\n\nconst ToggledIndex = createToggledComponent({\n  connect,\n  state: \"core.authentication.isAuthenticated\",\n  components: {\n     Authenticated: HomePage,\n     Anonymous: LandingPage,\n  },\n})\n\nfunction App(props) {\n  return (\n    <Provider store={store}>\n      <Router>\n        <Route path={\"/\"} component={ToggledIndex} exact />\n      </Router>\n    </Provider>\n  )\n}\n\nexport default App\n```\n\nReturns **[Function][5]** A connected component that has some state mapped for toggling.\n\n[1]: #createtoggledcomponent\n\n[2]: #parameters\n\n[3]: #examples\n\n[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n","readmeFilename":"README.md"}