{"_id":"@bristolinfotech/history-get-user-confirmation-redux","_rev":"4-b0118fe6a5bda8a9301bd671871a0edf","name":"@bristolinfotech/history-get-user-confirmation-redux","description":"Redux integration for history getUserConfirmation","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bristolinfotech/history-get-user-confirmation-redux","version":"1.0.0","description":"Redux integration for history getUserConfirmation","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && yarn lint && tsc","start":"concurrently \"yarn watch:typescript\" \"yarn watch:lint\"","lint":"tslint -t stylish -c tslint.json -p tsconfig.json 'src/**/*.ts' 'src/**/*.tsx'","watch:typescript":"tsc --watch","watch:lint":"watch -p \"src/**/*.ts\" -p \"src/**/*.tsx\" -c \"yarn lint\""},"authors":["Carl Craig <carl@bristolinfotech.com>","Loki Wijnen <loki@bristolinfotech.com>"],"license":"MIT","dependencies":{"@types/history":"^4.6.1","history":"^4.7.2","redux":"^3.7.2"},"devDependencies":{"@bristolinfotech/tslint-rules":"^1.0.0","concurrently":"^3.5.0","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","watch-cli":"^0.2.2"},"peerDependencies":{"react":">=15.0.0"},"gitHead":"d24c6999ee684f62052854117e4dd146f641db4a","_id":"@bristolinfotech/history-get-user-confirmation-redux@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},"dist":{"integrity":"sha512-EBPkrA8UuxjFSuC6wKI7kbFrS4y8Pyms7rA5grz/4lDbf2Z3Ercu9jv9cJn3hfg8l9mzVgXToa/WBYyDgwWduA==","shasum":"8b0f9720e02e3c70f0febaf25c42604a62aa8f40","tarball":"https://registry.npmjs.org/@bristolinfotech/history-get-user-confirmation-redux/-/history-get-user-confirmation-redux-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUqZ2NxqM5KYUlt08eLOaiOhpr1HxkCu92jVdUlFM0PAiEA7M2PcvXVWlCMBiYju7ngVJNiRMRzqi8JBmt0njQ7rB8="}]},"maintainers":[{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/history-get-user-confirmation-redux-1.0.0.tgz_1508754375813_0.08606068161316216"}},"1.0.1":{"name":"@bristolinfotech/history-get-user-confirmation-redux","version":"1.0.1","description":"Redux integration for history getUserConfirmation","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && yarn lint && tsc","start":"concurrently \"yarn watch:typescript\" \"yarn watch:lint\"","lint":"tslint -t stylish -c tslint.json -p tsconfig.json 'src/**/*.ts' 'src/**/*.tsx'","watch:typescript":"tsc --watch","watch:lint":"watch -p \"src/**/*.ts\" -p \"src/**/*.tsx\" -c \"yarn lint\""},"authors":["Carl Craig <carl@bristolinfotech.com>","Loki Wijnen <loki@bristolinfotech.com>"],"license":"MIT","dependencies":{"@types/history":"^4.6.1","history":"^4.7.2","redux":"^3.7.2"},"devDependencies":{"@bristolinfotech/tslint-rules":"^1.0.0","concurrently":"^3.5.0","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","watch-cli":"^0.2.2"},"peerDependencies":{"react":">=15.0.0"},"gitHead":"dbc43dcd51d1457bd27fa024198eece16c918277","_id":"@bristolinfotech/history-get-user-confirmation-redux@1.0.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},"dist":{"integrity":"sha512-zEVO8u6Dvo8JuEU0KK81VdvFwvYc3bGWT0Y5ySGlXPFc02LNVQoy8l054ivmCR8BS2OVf3RG1u+80AoJnZ/3Yw==","shasum":"e7b79581c2f0cd1335d9bd4e3da5f9780a906f2a","tarball":"https://registry.npmjs.org/@bristolinfotech/history-get-user-confirmation-redux/-/history-get-user-confirmation-redux-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE6Z9kJSU6mhKC341MfY+9tscZUYU3daoo4eNzdv7LL0AiEA3MH5UHZmaQynvHC9khIaTCebD7mJ8140qTCBileHemI="}]},"maintainers":[{"email":"npmjs@kloki.com","name":"lokiwijnen"},{"email":"carlcraig.threeceestudios@gmail.com","name":"carlcraig"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/history-get-user-confirmation-redux-1.0.1.tgz_1508774465588_0.6192944573704153"}},"1.0.2":{"name":"@bristolinfotech/history-get-user-confirmation-redux","version":"1.0.2","description":"Redux integration for history getUserConfirmation","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && yarn lint && tsc","start":"concurrently \"yarn watch:typescript\" \"yarn watch:lint\"","lint":"tslint -t stylish -c tslint.json -p tsconfig.json 'src/**/*.ts' 'src/**/*.tsx'","watch:typescript":"tsc --watch","watch:lint":"watch -p \"src/**/*.ts\" -p \"src/**/*.tsx\" -c \"yarn lint\""},"authors":["Carl Craig <carl@bristolinfotech.com>","Loki Wijnen <loki@bristolinfotech.com>"],"license":"MIT","dependencies":{"@types/history":"^4.6.1","history":"^4.7.2","redux":"^3.7.2"},"devDependencies":{"@bristolinfotech/tslint-rules":"^1.0.0","concurrently":"^3.5.0","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","watch-cli":"^0.2.2"},"peerDependencies":{"react":">=15.0.0"},"gitHead":"899fda82741e6315c70cc1a2f1716a395d1d9234","_id":"@bristolinfotech/history-get-user-confirmation-redux@1.0.2","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},"dist":{"integrity":"sha512-R9XW9hLA0lbAVpTtVwMr/I2O0Ypc8bCMSOezWvgAWYemhVPz9J1rFWLlyVl4gK7ayfSPp5oBZa516bYZSp2jSw==","shasum":"e5724dd401d5b4a69720d649efea02c2af5c934e","tarball":"https://registry.npmjs.org/@bristolinfotech/history-get-user-confirmation-redux/-/history-get-user-confirmation-redux-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdQlcXpZnVuFOZvpqNJvaBsnYaSnfa7wF/LiE9Gw9wFwIgPiKGtyn7rWYFJp8f+/4TbmFOCUCmFaExSjC9xg2IQDM="}]},"maintainers":[{"email":"npmjs@kloki.com","name":"lokiwijnen"},{"email":"carlcraig.threeceestudios@gmail.com","name":"carlcraig"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/history-get-user-confirmation-redux-1.0.2.tgz_1508776460346_0.11218876158818603"}}},"readme":"history-get-user-confirmation-redux\r\n===================================\r\n\r\n> Redux integration for history getUserConfirmation\r\n\r\nInstallation\r\n------------\r\n\r\n```\r\nyarn add @bristolinfotech/history-get-user-confirmation-redux\r\n```\r\n\r\nUsage\r\n-----\r\n\r\n#### Store Integration\r\n\r\n```js\r\n// store creation\r\n\r\nimport createBrowserHistory from 'history/createBrowserHistory';\r\nimport {\r\n  createHistoryGetUserConfirmationConnector,\r\n  historyGetUserConfirmationHandler,\r\n  createHistoryGetUserConfirmationMiddleware,\r\n  historyGetUserConfirmationReducer,\r\n} from '@bristolinfotech/history-get-user-confirmation-redux';\r\n\r\n// connector will link history to middleware\r\nconst historyGetUserConfirmationConnector = createHistoryGetUserConfirmationConnector();\r\n\r\n// add the handler to history getUserConfirmation\r\nexport const history = createBrowserHistory({\r\n  getUserConfirmation: historyGetUserConfirmationHandler(historyGetUserConfirmationConnector),\r\n});\r\n\r\n// create the middleware passing it the connector\r\nconst historyGetUserConfirmationMiddleware = createHistoryGetUserConfirmationMiddleware(\r\n  historyGetUserConfirmationConnector,\r\n);\r\n\r\n// add the reducer and middleware to your store\r\nconst store = createStore(\r\n  historyGetUserConfirmationReducer,\r\n  applyMiddleware(historyGetUserConfirmationMiddleware),\r\n);\r\n```\r\n\r\n#### Example Confirmation Component\r\n\r\n```js\r\n// custom confirmation component\r\n\r\nimport { connect } from 'react-redux';\r\nimport {\r\n  historyGetUserConfirmationReject,\r\n  historyGetUserConfirmationAccept,\r\n} from '@bristolinfotech/history-get-user-confirmation-redux';\r\n\r\nconst MyConfirmationComponent = (props) => {\r\n  if (this.props.active) {\r\n    return (\r\n      <div>\r\n        {this.props.message}\r\n        <br />\r\n        <button onClick={this.props.historyGetUserConfirmationReject}>Cancel</button>\r\n        <button onClick={this.props.historyGetUserConfirmationAccept}>Confirm</button>\r\n      </div>\r\n    );\r\n  } else {\r\n    return null;\r\n  }\r\n}\r\n\r\nconst mapStateToProps = (state) => ({\r\n  active: state.historyGetUserConfirmation.active,\r\n  message: state.historyGetUserConfirmation.message,\r\n});\r\n\r\nconst mapDispatchToProps = (dispatch) => ({\r\n  historyGetUserConfirmationAccept: () => dispatch(historyGetUserConfirmationAccept()),\r\n  historyGetUserConfirmationReject: () => dispatch(historyGetUserConfirmationReject()),\r\n});\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(MyConfirmationComponent);\r\n```\r\n","maintainers":[{"email":"npmjs@kloki.com","name":"lokiwijnen"},{"email":"carlcraig.threeceestudios@gmail.com","name":"carlcraig"}],"time":{"modified":"2022-04-04T20:42:33.433Z","created":"2017-10-23T10:26:16.709Z","1.0.0":"2017-10-23T10:26:16.709Z","1.0.1":"2017-10-23T16:01:06.724Z","1.0.2":"2017-10-23T16:34:22.691Z"},"license":"MIT","readmeFilename":"README.md"}