{"_id":"@modular-toolkit/hocs","_rev":"26-ec12ebb91c83ea96601b95709b4d403c","name":"@modular-toolkit/hocs","dist-tags":{"latest":"4.0.4","beta":"5.0.0-beta.1"},"versions":{"1.0.2":{"name":"@modular-toolkit/hocs","version":"1.0.2","description":"Higher order components (HoCs) for connecting modules","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^1.0.2","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"react":">=15.0.0 <17.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux":">=3.0.0 <4.0.0"},"_id":"@modular-toolkit/hocs@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-xhCpASjSEzhLoo8vFPABLlalNffHgAvr025OQHt53ST9RCHgRUPgAAxgQqWHYhsFhy3lwSAajr6JyXOxpX4Ehg==","shasum":"a604d21b70b8bad0fd1b72e92892bf87ceeb1f8f","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-1.0.2.tgz","fileCount":27,"unpackedSize":28101,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICU+bKYWwcSdfpBeNsCiTqt+ez0vybhUSnf/f4gkH1tLAiBSTW5XAjjg1TyB/451mrq+6PpWXclmVVliDkRYXLJRSQ=="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_1.0.2_1520600632326_0.9258363765659252"},"_hasShrinkwrap":false},"2.0.0-beta.0":{"name":"@modular-toolkit/hocs","version":"2.0.0-beta.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0-beta.0","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for dispatching actions on `componentWillMount`.\nJust reduces some boilerplate:\n\n    lifecycle({\n        componentWillMount({ foo }) {\n            someActionDispatcher(foo);\n        }\n    })\n\n…can now be written as:\n\n    import { bootstrap } from '@modular-toolkit/hocs';\n    bootstrap({ foo } => someActionDispatcher(foo));\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n    import { callHandlerOnResize } from '@modular-toolkit/hocs';\n    withHandlers({\n        doSomething: () => () => console.log('window was resized');\n    }),\n    callHandlerOnResize('doSomething');\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n    connect(state => {\n       foo: getFoo(state),\n       bar: getBar(state)\n    });\n\ncan now be written as:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        foo: getFoo,\n        bar: getBar\n    });\n\nIt also works with nested states props:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        car: {\n            color: getCarColor,\n            ownerName: getUserName\n        }\n    })\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [omitProps](src/omitProps.js)\n\n[Recompose](https://github.com/acdlite/recompose) enhancer that removes props.\nThis helps minimizing property pollution.\n\nExample:\n\n    import { omitProps } from '@modular-toolkit/hocs';\n    omitProps(['thisPropWillNotExistAnymore']);\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n    import { onLocationChanged } from '@modular-toolkit/hocs';\n    onLocationChanged(props => console.log('Location has changed :)'))\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n    import { compose, withProps } from 'recompose';\n    import { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n    \n    const ThemeProvider = compose(\n       provideContext('theme', {\n           backgroundColor: PropTypes.string,\n           textColor: PropTypes.string\n       }, props => {\n           if (props.desiredColors === 'green') {\n               return {\n                   backgroundColor: 'lightGreen',\n                   textColor: 'darkGreen'\n               }\n           } else {\n               return {\n                   backgroundColor: 'white',\n                   textColor: 'black'\n               }\n           }\n       })\n    )(/* … */);\n\n    const ThemeableInput = compose(\n        subscribeToContext('theme', {\n            backgroundColor: PropTypes.string,\n            textColor: PropsTypes.string\n        }),\n        withProps(({ backgroundColor, textColor}) => {\n            console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n        })\n    )(/* … */);\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n    import { compose } from 'recompose';\n    import { withRefs } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withRefs(),\n        /* … */\n    )(/* … */);\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n    <img ref={setRef('myImage')} />\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n    import { withState } from '@modular-toolkit/hocs';\n    import { withProps } from 'recompose';\n    \n    withState('car', 'setCar', 'updateCar', () => ({\n        color: 'red',\n        maxSpeed: 240,\n    }));\n    \n    withProps(({ car, setCar, updateCar }) => {\n        updateCar({ color: 'blue' });\n\n        // the above is the same as\n        setCar({\n           ...car,\n           color: 'blue'\n        });\n    });\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n    import { compose } from 'recompose';\n    import { withWindowSize } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withWindowSize(),\n        withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width)\n    );\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@2.0.0-beta.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-79AiZfXkYjHrV0wwGrlO+1ZzawZgJy1B6aNnyUxrJFTyTBV6HvVklvqwX/ljHJHOC925l+uzsIA05O9zQCqDKg==","shasum":"f6641245c101bc5e1eab950823b0c36c1ee9035b","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-2.0.0-beta.0.tgz","fileCount":30,"unpackedSize":69786,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBX1FuRcjsQzz1mPxCpWxbMTiDr0uNkyac5S2n+RdgadAiAljzLDd9BDFqOBOb3D1nb/PknWr5kfPzd34gwMZb6c7A=="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_2.0.0-beta.0_1521024684188_0.7293231801912317"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"@modular-toolkit/hocs","version":"2.0.0-beta.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0-beta.1","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for dispatching actions on `componentWillMount`.\nJust reduces some boilerplate:\n\n    lifecycle({\n        componentWillMount({ foo }) {\n            someActionDispatcher(foo);\n        }\n    })\n\n…can now be written as:\n\n    import { bootstrap } from '@modular-toolkit/hocs';\n    bootstrap({ foo } => someActionDispatcher(foo));\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n    import { callHandlerOnResize } from '@modular-toolkit/hocs';\n    withHandlers({\n        doSomething: () => () => console.log('window was resized');\n    }),\n    callHandlerOnResize('doSomething');\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n    connect(state => {\n       foo: getFoo(state),\n       bar: getBar(state)\n    });\n\ncan now be written as:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        foo: getFoo,\n        bar: getBar\n    });\n\nIt also works with nested states props:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        car: {\n            color: getCarColor,\n            ownerName: getUserName\n        }\n    })\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [omitProps](src/omitProps.js)\n\n[Recompose](https://github.com/acdlite/recompose) enhancer that removes props.\nThis helps minimizing property pollution.\n\nExample:\n\n    import { omitProps } from '@modular-toolkit/hocs';\n    omitProps(['thisPropWillNotExistAnymore']);\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n    import { onLocationChanged } from '@modular-toolkit/hocs';\n    onLocationChanged(props => console.log('Location has changed :)'))\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n    import { compose, withProps } from 'recompose';\n    import { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n    \n    const ThemeProvider = compose(\n       provideContext('theme', {\n           backgroundColor: PropTypes.string,\n           textColor: PropTypes.string\n       }, props => {\n           if (props.desiredColors === 'green') {\n               return {\n                   backgroundColor: 'lightGreen',\n                   textColor: 'darkGreen'\n               }\n           } else {\n               return {\n                   backgroundColor: 'white',\n                   textColor: 'black'\n               }\n           }\n       })\n    )(/* … */);\n\n    const ThemeableInput = compose(\n        subscribeToContext('theme', {\n            backgroundColor: PropTypes.string,\n            textColor: PropsTypes.string\n        }),\n        withProps(({ backgroundColor, textColor}) => {\n            console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n        })\n    )(/* … */);\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n    import { compose } from 'recompose';\n    import { withRefs } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withRefs(),\n        /* … */\n    )(/* … */);\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n    <img ref={setRef('myImage')} />\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n    import { withState } from '@modular-toolkit/hocs';\n    import { withProps } from 'recompose';\n    \n    withState('car', 'setCar', 'updateCar', () => ({\n        color: 'red',\n        maxSpeed: 240,\n    }));\n    \n    withProps(({ car, setCar, updateCar }) => {\n        updateCar({ color: 'blue' });\n\n        // the above is the same as\n        setCar({\n           ...car,\n           color: 'blue'\n        });\n    });\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n    import { compose } from 'recompose';\n    import { withWindowSize } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withWindowSize(),\n        withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width)\n    );\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@2.0.0-beta.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-LCEEbNLrG+njUoT59jxBHPnu1FybLXk2GJFgXRnWNgAt4y5asxn6V7ueyca7vc1n0p9KhZ7v9btVtDqNRcoG9A==","shasum":"213c26be2e284a7c3304d308f06825b4eb5b9c1b","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-2.0.0-beta.1.tgz","fileCount":30,"unpackedSize":70949,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDM3FlEziUt16tmksSrFKY6F3JIUMl69eF5Uf5qGj0fxAiB1s0kxTDQQ8K4voNAp5ldur8BTINMXCvxfchv4/VMNkA=="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_2.0.0-beta.1_1521035767148_0.261446331654253"},"_hasShrinkwrap":false},"2.0.0":{"name":"@modular-toolkit/hocs","version":"2.0.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"_id":"@modular-toolkit/hocs@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-x6f/mW9V0V0Nzw1MKPuprab4duqpIzPsuZhpfwv9gVF4K8QbV0N+jIEmy6Yilvgk4kV7f6ESeCnWNltHscqDiQ==","shasum":"2e379ae3e23e817cf3fb03946453cb3811a59c42","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-2.0.0.tgz","fileCount":30,"unpackedSize":70935,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYX5t+kmUkFV+ShhAS3s5+at8PuAafZAMhza1YckNDxwIgZqTOeP/+c6bGPHRLd/JSB5dv1wkxE882eRJhqxhNiVQ="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_2.0.0_1521036056080_0.6541940698892508"},"_hasShrinkwrap":false},"2.1.0-beta.1":{"name":"@modular-toolkit/hocs","version":"2.1.0-beta.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for dispatching actions on `componentWillMount`.\nJust reduces some boilerplate:\n\n    lifecycle({\n        componentWillMount({ foo }) {\n            someActionDispatcher(foo);\n        }\n    })\n\n…can now be written as:\n\n    import { bootstrap } from '@modular-toolkit/hocs';\n    bootstrap({ foo } => someActionDispatcher(foo));\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n    import { callHandlerOnResize } from '@modular-toolkit/hocs';\n    withHandlers({\n        doSomething: () => () => console.log('window was resized');\n    }),\n    callHandlerOnResize('doSomething');\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n    connect(state => {\n       foo: getFoo(state),\n       bar: getBar(state)\n    });\n\ncan now be written as:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        foo: getFoo,\n        bar: getBar\n    });\n\nIt also works with nested states props:\n\n    import { connectSelectors } from '@modular-toolkit/hocs';\n    connectSelectors({\n        car: {\n            color: getCarColor,\n            ownerName: getUserName\n        }\n    })\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [omitProps](src/omitProps.js)\n\n[Recompose](https://github.com/acdlite/recompose) enhancer that removes props.\nThis helps minimizing property pollution.\n\nExample:\n\n    import { omitProps } from '@modular-toolkit/hocs';\n    omitProps(['thisPropWillNotExistAnymore']);\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n    import { onLocationChanged } from '@modular-toolkit/hocs';\n    onLocationChanged(props => console.log('Location has changed :)'))\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n    import { compose, withProps } from 'recompose';\n    import { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n    \n    const ThemeProvider = compose(\n       provideContext('theme', {\n           backgroundColor: PropTypes.string,\n           textColor: PropTypes.string\n       }, props => {\n           if (props.desiredColors === 'green') {\n               return {\n                   backgroundColor: 'lightGreen',\n                   textColor: 'darkGreen'\n               }\n           } else {\n               return {\n                   backgroundColor: 'white',\n                   textColor: 'black'\n               }\n           }\n       })\n    )(/* … */);\n\n    const ThemeableInput = compose(\n        subscribeToContext('theme', {\n            backgroundColor: PropTypes.string,\n            textColor: PropsTypes.string\n        }),\n        withProps(({ backgroundColor, textColor}) => {\n            console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n        })\n    )(/* … */);\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n    import { compose } from 'recompose';\n    import { withRefs } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withRefs(),\n        /* … */\n    )(/* … */);\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n    <img ref={setRef('myImage')} />\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n    import { withState } from '@modular-toolkit/hocs';\n    import { withProps } from 'recompose';\n    \n    withState('car', 'setCar', 'updateCar', () => ({\n        color: 'red',\n        maxSpeed: 240,\n    }));\n    \n    withProps(({ car, setCar, updateCar }) => {\n        updateCar({ color: 'blue' });\n\n        // the above is the same as\n        setCar({\n           ...car,\n           color: 'blue'\n        });\n    });\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n    import { compose } from 'recompose';\n    import { withWindowSize } from '@modular-toolkit/hocs';\n    \n    const Hoc = compose(\n        withWindowSize(),\n        withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width)\n    );\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@2.1.0-beta.1","_npmVersion":"5.7.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-ptMad6buAox9Hq3UEpS86DE7H9IRtGm1pp1HmIFALdOYCuZU34KgMw6ioNOQVZZW+sND68PRP6s+emjW9hUK0A==","shasum":"931ff07669a48ebb1607eb67207c85eef6dfe3dc","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-2.1.0-beta.1.tgz","fileCount":30,"unpackedSize":71001,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEP1YY09gR2f6YaBr9lawn9ei8rExAbzivPWvzUEOBbrAiBmH2p21EWgqEIORgQsV0GTM2W2e5FRqovLTS5O4cL0Sw=="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_2.1.0-beta.1_1521451747757_0.9887868758878946"},"_hasShrinkwrap":false},"2.1.1":{"name":"@modular-toolkit/hocs","version":"2.1.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0","lodash.debounce":"^4.0.8","lodash.omit":"^4.5.0"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"_id":"@modular-toolkit/hocs@2.1.1","_npmVersion":"5.7.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-TvubGahi/Je9ZNRPr2IkWSZ7eLFw0Tyo+D/e0h4/rdEPAlfRbNrd2BD6nwHL2v1tmdbedAtrY8mJJpC6FyVCuA==","shasum":"38239b106802421b84838ad39097bf69cda9473d","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-2.1.1.tgz","fileCount":30,"unpackedSize":70982,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFagglEbWhMgx6GhBk91bxSnZ9NK1WBGD9qfw3HozHqYAiAYZAljYz7t+sp1HGQtXlkeuDLVCOUSwf2+SNtOq/rGpQ=="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_2.1.1_1521454202257_0.595737736239714"},"_hasShrinkwrap":false},"3.0.0":{"name":"@modular-toolkit/hocs","version":"3.0.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"_id":"@modular-toolkit/hocs@3.0.0","_npmVersion":"5.8.0","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-88GoF7eIY1MuyXpDPxnVrjUczOOelod95w13JRnyGJ0DZBNc5PmFCfj47EpLmLi9w8GpUEHy64NyGx2pqbZieA==","shasum":"29c20d1eee777d1a5e9dbe564a7d55e2cde6ad6c","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-3.0.0.tgz","fileCount":28,"unpackedSize":62988,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4AB7dClQsjHRWEWINqmIX4KG9C0WQwvfkzCiaQz3yIAiEA9Wv+RiCdBM6jJi8HJhmssVH4iS/iYyDD0PLo0EFSl7c="}]},"maintainers":[{"name":"pahund","email":"pahund@team.mobile.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_3.0.0_1522921003351_0.7787715037251672"},"_hasShrinkwrap":false},"3.1.0-beta.2":{"name":"@modular-toolkit/hocs","version":"3.1.0-beta.2","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.0","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for dispatching actions on `componentWillMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentWillMount({ foo }) {\n        someActionDispatcher(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someActionDispatcher(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@3.1.0-beta.2","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-CL6G5XXL519fEIB3ad8NVLhT6JjrPHvIo8FdVDR8uur+ehWh9XuA5fHS2moAvvACmIgp5Ofw1+mMveMp1pKb9g==","shasum":"3b944f1268ff56af85fa85836830e8135156c1b3","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-3.1.0-beta.2.tgz","fileCount":28,"unpackedSize":65024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqfHCCRA9TVsSAnZWagAAplwP/1sYQ+Xx4yrHxhKm9JRb\nsVVbdtBWb9GCTSmkbneZL9XT+bzCEPShR0lD7FBd0XNIH2BSiALhu4nUyARv\nvADfvIvh2MgUS94gqxixuW7YLBvjl69ihl1eMjH5964YfEPtRS8GZz1wKrOr\nI7OTX+Nf6AFyadSUiVyo4iE6edPGWnN0FbD7/NiPhyVfj1j3s4cAJcCq8uMw\neeB19srUcEseE5LKV3q7ohXSo1iLxEqaEsnqsCL0jYpU78D62GP6CypNR+5u\nWh7vXwYB8s9cCbakZQ3h2p5pfAUMgJATJdwKGTmkbRY7eQg2r0R/yK7ovSSq\nYDBFe2yibcrdSjy0IReHhx3DaYEAT6QHgVl99Rieg+BYKvRFntgU0b4D2e+3\nvQXobiip+W0kLnQobci7exO2MnfNIBjS4dTgAs/LGv0HPM43u1aJNT2vw7mq\nIpU3yrN7Kg5/dd7WIhnNfjd2212apim565qOs1L6ccj1gT/8jSWSWNByUp3d\nBhI46M6kELiHIQgQjkaB8bV+WgBYcP2q5964p5v8r5isykNXmgI6cWIqROyC\nc7YEw+7nGXZ7a1UzqHvRsjcnnf6WFULdTN6MoJxdaOtgwr6X73/DXLJQKJId\nYyjjEPZ7fqW4y5cigmVRYbMO8jo1uYb7y8kryPGf3mnR9VilsRRkQNoffheI\nfvcY\r\n=4DWa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENwrABP+kHrPj7ao2G7f2AUSlW+IMF8qEFYPT81pVAsAiA0Vr+TdoB1+0c9rSx1+90/QahdOqkECFnWJ7Zim0ufnw=="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_3.1.0-beta.2_1537864129824_0.7357940190046031"},"_hasShrinkwrap":false},"3.1.1":{"name":"@modular-toolkit/hocs","version":"3.1.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.1","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"_id":"@modular-toolkit/hocs@3.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-Ug2ua3VT8vTfDp3g/GPMX1+99ir/cc1CvZaDLE7T38ENEXQiQmKWXVa1/D2afiPoZ9nsmi4O95i1FN44bdilxw==","shasum":"1a7d9cfacc30fecf7c365ac67365bd652d5c53c8","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-3.1.1.tgz","fileCount":28,"unpackedSize":65017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqkmECRA9TVsSAnZWagAA9x8P+QBVylxF3aFEcpTjDJ+T\nZlXxhd1H9w0icUz6ypP5znZJABSxna7dz4pKZymmF6PKrGH6mFLbRsVzFngQ\nv8a7zG+cqMOoJx0jik+1cQEQbZTjS6pqLapWixEAqX5W5dSHnRqaDcEWe7F7\nIO8+SE846UxISPWi+BobqHPKkcOVLzpmA1tsWFkiEzdeOREW0BuQGn994Cym\n2g1lWETUvNAsMY0UGSGoWlUzYloU+RwL+Gvuc5NbFPi1yWglgZFdexvCMqM4\n880xlPzuN0BBIW4Wap0P+Im3SHHxWfnXbPN4GR22+QraYFZOzpkdKybn3Hc/\npSUyVNQCRlF8v0Ch4kG2Npwu8CVCPmO0kSXtVVWHhxGtgvbhfzSBCmA61An7\nfm2EmAhO1X98Ag5Bmw4XRhQbN8CHxUeaZAsMosWfhsTReIlk5EBlQ+QQtzHP\n3aomviZgQHHK/2N3MWWaeu8x/3IGU4+80UCbnXs+FaLoFzTgMPp8LXtCp3Dt\n9nSaBsizhfA3OsMIcBCuVmVmMYhxuSEtrX9sBbk3k74uXLg1lpw8C9EJNU92\nlHfta6bfJb8C+xzMZNw9wjyuaVhga5UqvB3xW/YYx4bkvPHLWN0PR1c18RYj\n6k3+kU5qZDohKP60vGbxsO8eFztAEzf9rOEBTBRbo1ShYgO91xTkLLEnxv3H\ngw3b\r\n=Q2/T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyjMR4sMWeYgleNbJ3rQ7zU/5ubbhL3W62X6L9peKDrgIgDqv6CMrmFrzZR4TGOMbSuaH4sTf9Ic5AM8ueqS6d9WM="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_3.1.1_1537886595753_0.07736079679095642"},"_hasShrinkwrap":false},"3.1.2":{"name":"@modular-toolkit/hocs","version":"3.1.2","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.2","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.1.1","webpack-cli":"^2.0.10"},"_id":"@modular-toolkit/hocs@3.1.2","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-D7KjFh897feQ3BnWUE72A9KBbfYK1pQsINsX2zRtWzhUPtmPpI/R7aorLpJYyv9bqfv/GLFXH1/DisE9ztcgMA==","shasum":"84e89935fe7890f778899c2d41cd3537178098d0","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-3.1.2.tgz","fileCount":28,"unpackedSize":65017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqknECRA9TVsSAnZWagAAwxIP/0syYmhIewVPzZjurtxC\nEVatnTfX4NVyiDJ2vcO6fL+7cGeJ2eZ6OgO1oQTaa75qFf7l3l8q6D5T9mXB\nA0gzkqlIWrwDBFMoKjQoj29uHZF2KLCFcq/Pb/jLS4WAu+mhwHljkEDYfmtt\nDoQ44U85lvUAgk3s2mgkjwwU2sx/Gy2UrvyDYY4jscOfS2ZY3dx9yJKsBUtE\n43BjrmeKsGIEVKqWAI0lI7aDKtRjSiOplJr0QcLGp5/1Cv0mNdGT7hh/to8+\nCKsAgCM952VDuHME11YiPuzzvKwg61+2/RG/6MnUHh4eGSk41CPS+ip161LX\nsydjplfFnw0S3uEjqhxVpzwevwk4paPhT7dUg0sJWTbcwLSuiGNJyqRfuyNv\nYTy+SKcvF4xw/110TsmD3yOOrh9243ush2nbzOAMIiuppthNembsenrWEPYW\n/HC0zb+DUN9d+/0P1tvuyy573oZbyYSVPSpo/acZUWDJI+BotGV9ZimhUP8x\nKOybTbJ0rV0fHrl1yG6QufIlrPR6A/ZnGcQwk63rxFvI9teB0ikNDQgamHtb\nuYLADfDBPuFHOjOWcsJSMW7Jr+HmnO0rvKNGqN+9Y/mui0d70UXvk/7hCrX1\ncqtWPNs3QgYk/VJU6VZhb5KPgMigJs90TarUqeu3ecPoFaprMGZ32wM75CL+\n1BRg\r\n=8RzI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+cQ3cuIa0V+DLfdbXqp+YGsfK0NMMPlcNL8YJccXO8QIgQE4PSG8MlmZMPxfo5NioF6238YDVGc8BJcVhSdaFdQY="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_3.1.2_1537886659939_0.787666982457351"},"_hasShrinkwrap":false},"3.1.3":{"name":"@modular-toolkit/hocs","version":"3.1.3","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^2.0.3","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"_id":"@modular-toolkit/hocs@3.1.3","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-Q9e/f5dMdDVnoApIdGHFtvXiwT67uQkkhD7tvNak9STXkTgtOxdLEQqFR3ENmyzQy3iARluyjle8mk0we2dQhg==","shasum":"73d67968ca031484a9af7f585bc53cced5dbbdbd","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-3.1.3.tgz","fileCount":28,"unpackedSize":65614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvJ0MCRA9TVsSAnZWagAAq/EP/124II8WEH8HAiz71qdI\nwIP0VpqytUyougMHDC603DgwIkSnSk4gkAMMlZBBzWnC9yUirBLHurJjf76g\n/d1Aqm42rr/zvvKZU4IaWh4tELpz8fYDpii4X2CQJ7Np1rBZuhaCKniVpU1A\nf/0hZDHKPXHyg4jC/JRPBn1UFYycHFAbG4W40jzEHgdNWHAZmQRaOiPbgDGj\nhXxT842svXhEsmGIE3QzST4kZ2Pm6QI3YHPXZS7O3bidthlIc122AGwTvk73\nyWFVAXBvTCgULSSlwBNsw9HCTMPm/xi+6oVc21KoUuLOOdPgyiK02xvo/Y1z\nDII1XH4e+In7p0fe0ay3EHn+P3AocIKVMC+7wVGBYJMEW71ish8H7PHMpCCD\nRHIrnUmjZMtZAftchUuuhy02GCN7DQ/HLGgLmxkD8VxGJL2XwkXpDwo6+nfD\nonBikTgpkvwQ+BPD8l6nE4B+hOCMEquGWstW5A6aW4OtCruYwHrAilTzybrh\nSuRXvTxnlM3up9+2ADAinuOjlmJWDOiCzWzL3glUesQlXfHuDrGPF1GZCiLs\nKL5LCqeCL7tgA8gJI6PE3GpScttDkDwa3lMk6xiAJDM20nWE7OXx5HCtb6QQ\n45LEffr1aBrRUx0JAW6hM0GNSBNJwVs8kKd/yTt1uEIpay4JpMDGyYkybzrS\nEUPv\r\n=zqQZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjkOzuDXviFPz4bdTmmeMcuv7xrCAwua1vBOfR30pSkAiEAndCZ13QxGP+eXeQkO6fjAb3z6ii9MugFJq6pdRCJtJc="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_3.1.3_1539087627800_0.7136605856966547"},"_hasShrinkwrap":false},"4.0.0-alpha.0":{"name":"@modular-toolkit/hocs","version":"4.0.0-alpha.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.0-alpha.0","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"cb26fcbcaaf9f804dd1e844a3fccebc02cede530","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.0-alpha.0.tgz","readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for executing code on `componentDidMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentDidMount({ foo }) {\n        someCallback(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someCallback(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@4.0.0-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-z0GYLymHHyQMHOAdrxwlXzzEtOr9Bkd5MCA+uSif6s5LguwlSWpQn4lVqvKUhVYhgeeZNfT8BcC+WD+ELtbYGg==","shasum":"23140629b05a01e92cbf37c1d75d136d219e22f1","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.0-alpha.0.tgz","fileCount":28,"unpackedSize":66593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxvkICRA9TVsSAnZWagAAoV0QAIiXZqBcz8O+vWp57QsJ\nH0iL6c2IMADbfCiYzFs95dRh0xjHzJwNP/jxpVvCscWDkP4GAZB/gUEXric6\nTOh4R/KvtnrK7fwldSbCskSqbQoxQ43pOmonGcrVuBFChgLq4FANwIcWdOzN\nUiqYMVfuBfHwbH3m2pz+9v35M1P8s2eGFp1a6PdpZb3zvxw9ReXbR8OvyvfU\nt4JYXJBltsfXGzTEoVAaGu6cxPCmIgDzyN8kqc8j3i3yzJVOJQQQKvzP3oVF\n1wwJnZPB4V9mqRJQn6TVYRmU6BVIpX73RRgi0GsCMm0953naHErw4ZrYlBip\nwUuwWIXImPw960RkPTK1as0RmfpmmXx4XWZlPF+VUH1HDiDiKwl/n7tIH3O6\nNoaJPUpndrHpMBXBrrz47nmjwh/OVe4QC7hTHu/NMH2Bc+3ls/R91giDe/PV\n9gWpEMU2/pmCcOLTcnG1YObm1WQOUqUpdRCqSG3RkE9GLKoXQKaCZ7hf3Jxk\nNLfAxPpSZYDJjt17b5XV2FF+voKkqCGfMzH9kn1GsirQcn13IhNLY6MeE2nw\nsbkswZMC+nIabs22WdOEAB/mmNYzRpJWlNa+GC33SDkVUcNQGg0kJOBRRJjR\ni9zTeAmSGEOdifEroYXj1fBOTbiKS1ZigDwd0mG9/uUV/ZFkUWtMfmL0raXF\ndwo7\r\n=CGYU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkM4AgmZOpTVY+xVK6XB2f0mjIEBY8F6I/BxXVsCkPXgIhAJEyeTRn0jwgA5m7bVt5BuVmwiT7EA2XOVTMhw3fzuZd"}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.0-alpha.0_1539766534816_0.18483326044199"},"_hasShrinkwrap":false},"4.0.0":{"name":"@modular-toolkit/hocs","version":"4.0.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.0","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"9e0fdbe177e5995fba1226bf1ef85ee9285f62ee","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.0.tgz","_id":"@modular-toolkit/hocs@4.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-cLTddwyMTKfwnAgea16WYlKVhYcXHCRwTjUaF5fgcnBA03EtnPyX3sEy6lbb/DqUjdU4ITHmVHKhNJMbZmBCcw==","shasum":"21583a98434176afdb5b6ae451d82d4a7e5571f5","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.0.tgz","fileCount":28,"unpackedSize":66577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxwtfCRA9TVsSAnZWagAAqyIP/0EBl/tnA2P4VDQ0cCou\naEmWbQ5jc4odKRlzfrTHQpwt6s5dErouY49S48sRMhWq46a1z+JVhBZhS9ko\nHq44agVAP1Ee2SZ0VwN9TtQm+LyURWykipqqa/eErg/Co09G2tvo0G3+ZRJi\nqePqsjRfT9PYc0eU5Tg0E0WwRqsd9oEelCEj9mZsY+eXghATSTTNf9VpDvSl\nG5dzAB0d0425vJtuqbWO3UCgdFi5tDfxIwzR+iqtnk+fnftghPU5yNoCLAZX\n6e4x5Jf8LWhMTy2J4DUq6mjeGqzQ5WcsQfwjlHAT1ImSL8RhldBg2ypQX5ve\n3KeuhU3UhnG2ipSDf92hmyrCXrHZ09k/z9JF/ksL0FyLmBksMU+3R+04g6Uq\n+MjaGY1T65yYbk72eExmhzad+QnqiNwHjOBD5RLPcoZ4+g1PSvMz19f0BSea\nDVt2CcDPJ18jt8zn7YV++3ETockegjRuKzvXJBOB6tUOddOT/VhLs0dD5OBA\n/pRyr1c+yGKm9Iv+egfYNJ2qt09yt0YlBX9D4FFqo6olp1z6NLvOA+9YfYvt\nnuY/kujwYv1OhjsiC+Ojw+FVVejvTTxGCBAw2QKhMQf6VTDCk2ggQ2XJvxub\nT8dHtWvJGXJYDrYjeJgsRDxFBEnG/Cn1XLcXSl7mAbFcNv0HFCjEG8AgiLpM\nrS8s\r\n=hZhh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi57Ad8rfmFYjbsViqhusEIaJvUn4E6arfdkoefcwEYwIgOQT0R3fVisILsd1YSUE+RZDGs3Ng4WjA2y8OrnD/X6g="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.0_1539771230808_0.300109970756703"},"_hasShrinkwrap":false},"4.0.1":{"name":"@modular-toolkit/hocs","version":"4.0.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.1","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"dc11b1034700fd6f3f91fb13b02ceae4860f252f","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.1.tgz","_id":"@modular-toolkit/hocs@4.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-feidIY2dy1Lm9KJ/xBu/x4V5Pv8UDPFxjpoUmF/ArRotOs/BLYVSBYiyeQNIZItAoWBSHrODX/0pN4atZMAcCQ==","shasum":"c95a32e8e92929b0b15bd362d1d01f8d9775e504","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.1.tgz","fileCount":28,"unpackedSize":66577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0XPeCRA9TVsSAnZWagAAX0MP/0MsPYvWi5jnGTmva4kD\nObxIGfKCTAFbv+xkbXWCm0asdyUV6HE8PsvUpJrKUwbUES8bOS/E4jNeT00n\nxgFk3WOohfwfNVUeTm4lhksGicPhGTZIKbWsiKkZ2y0QUMcu2g7ff2r9/5p3\nkPdWbBY+mE4h/uX7s4KrGlxxb9JPmihBLORhtai/HK/Ffb1ynC+IZhIIND5J\n4nzudYk21qcLnBhntFyWzaUcZySE0PIQkTnQr1b3s+WBsWPK03AfnyKIBvDC\n9dKauIbOAVMHZrRcivapaf72rNCCFzGV77k0TPGOGJIFOZQnHrE9QT/OHNr9\ntHXN7BCrA97nvf9xf2Zx7gb3O/WIxLmDFQjoPd73oCbyhIpYHz0MgbN1ZIGy\nZbeVZnh+9BN2qKu+aUHgxxEjfl75DBeQ49JkYHEA8mnASd0qaGE1peHc4i0u\n0m3rXQ2Hyf8C6REefilZDzFVrxRB/OuJnsGLd6hC8bedtetV60gMOzFeLWut\no9gD6dAQBBzjDJJ4TLY4g+DNb8CrbtxXPB6e4NZ3lGCYJFBdEl3PTKV0egxi\nsLa2iF7+17K0h0Z7k5672VwUGN6LgAx4jnD5gsvm0ktf/F2WGd9RR8xfMgpu\ndIgc45a1bwBi6LrV8eaBeP2YDemek5hCr6zFhXF88f0q33PiUivyceg+VtP7\nadx4\r\n=pmDN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkc6/IaZW6mjVFH4lJ11fZX+Mh56SfPe54sJIewWEs+wIgSt6KCu7nSkkxyvyi7xthocfpUGQmhASCUnw3C1BNNhg="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.1_1540453341474_0.16062154866456657"},"_hasShrinkwrap":false},"4.0.2":{"name":"@modular-toolkit/hocs","version":"4.0.2","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.2","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <4.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"131c54e0ecc4b0f9e39cb31d0d0b376f5a1e6995","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.2.tgz","_id":"@modular-toolkit/hocs@4.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-c0i4na+4fYNM6qDfno9vGcOj9L+pCwuvuOffI+ZMwPNv7ejIrlYEi6z2dp/+6LCci7SvVQMITwyW61qScCM64A==","shasum":"f5406c8f8a3926222cc213f5e22cdf0da598c15e","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.2.tgz","fileCount":28,"unpackedSize":45828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2YAdCRA9TVsSAnZWagAAiMsP/AxD9Jhlf9HAaZg5mOUm\n/ReqPwaiXUM0qdm7iWJQI+psoC3EKxXDPAsvCcI26eDB4BNpcLx9XEpPZGJR\n24+hZp2qFzQYCMM22DtjAJUErjxX1Nr6Y6wtrxUb+6KwM2NGhj9MX9w6PgsC\nimpqIUlwglrmtDj2Zhqm5zMzF6SHYf692RDJ6HR3+lGcoTMq6M+NgC6dBIJG\nRaxU2cVNIPPfSMv+GPjYqtNzkggRupO3zh2ZKfVj+Ju3WQ844RM8ffPeSDUG\njp+gKJpPbbVCzUMzJoelSXdmW8s6QqanwijJi/PctX8/mX5jcSOlgswzWt/m\nm1cyCwH7bK5VxUaLt6ONmeWyxvWCOk7/USXz27woPL7KP6s1wKUanwclaCt7\nZyu76wCjnf+dyH7P+5oFp3ygXkhMw09ZRJkR55c3fy4ovnicHFxh86mUK5yf\nTbfue5N0b5grMpNcGPzrKan1fG3uCK+Hl3tA0SF1S4HPAZ0vTNEjwy/OSfHt\nGBt6pi5krUAhw8KRXr8UJWfLsJimxuNEN0CQfdVEq6Ru5NXTTTvCNFFocrVj\nDZkJIlaQa+pEpNgQIeqSzwQE+GTOr9zymmheIoxMDS2NJFhw5cySFX88r5Pp\nq2rL8xbqMV/YXWg70fxuij9SfO1f616DsAmr0v7EZx4K7bzZGZdUBFrw7elr\nLHy0\r\n=H6eP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbrz18a0T/yCFsqnTI4Jfdsf7AHFZsfVlJ4lmtkSKyHAiEAmRSpHNUz+bnmRRDhf6V7N9aAV+N9vnAHIhmSPKvAinE="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.2_1540980764918_0.7574155512854814"},"_hasShrinkwrap":false},"4.0.3-beta.0":{"name":"@modular-toolkit/hocs","version":"4.0.3-beta.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.3-beta.0","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <4.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"862ed388ab2945225479f12878cb95f3cc238e43","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.3-beta.0.tgz","readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for executing code on `componentDidMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentDidMount({ foo }) {\n        someCallback(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someCallback(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@4.0.3-beta.0","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-SseFWruYiIAdV5z59uOKXxdwiwwXJxke8aUUh/zCaKgRp/gF2A3n7fxYXpaqbBdhJFe4jJ55qmVQqG8lh41s4w==","shasum":"13e91dbd20d1f19a8a89d37ee10a7b500eb73aeb","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.3-beta.0.tgz","fileCount":28,"unpackedSize":46122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHOvfCRA9TVsSAnZWagAA/2IQAJPhk9a5S4j1+15J6pXt\nGDbhuY9QRcMOsUVtURMQ2MIJyosxQ0WB2T3jJ7HaeTTILmLT98iNSPW2gv0N\nMatp+E6AGNoL30ArGOpaECf4SVcj/4iNGuK506ktYeAIn8FxxbfFzVPBzndJ\nEXzF0MUTor0HiNJDnbdSFjjFse7vwtGTjSICcYlv6BCqCzoqunF938eytwGF\noXjVZJAJbHgO/Zaz64mhulAgLQpMDXnjfFmoFQC3eFG7MApfGF+ItkqrFizm\nQJkeINa4b0CT7AJpDcxje/hXTT6azucxEF0NnNBiiw389wxfGJ0TH/za9XvV\noAyizOz+gact8P2gDBOU7XUSc5SX16CEiohsG3mE+NQbZJyzZ5qoJIrELI7w\nUa1ldzIbazW+nU+qniyaiKSol0Ojkh3e3p83pZac7ovgaEB73TyYfkyc2tPy\nUDmIwUU1uinRFLCbEI2hc+opgBJcAJxuwe0NysI7JeU6TJ5QAWno99B6VFAI\nE1a8qB/JIDKGF9j0DNl8ms9wUnWmLPHVHtEc6T7DU2VlTBDGlObl8/S9VlKh\napd0PKfQIvIkSRi5r+H12IcOlMwVGl/f/iyoindjeX8f0uvOGrleQApabELT\nDJLWFyo7RTGc2y3DgBpuPbRQyQaZWv60UuJ9yImtqsVtr51zOSsPMLwrIK+L\ndAEA\r\n=INCK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnOUvs9YBSdeLJNn554Ex6z2mPACqm+uSEmqDeh9+L3AiEA+D5TaUi7FSnyaVhouXzagOtdI9F+o4ZJug9KBb4cQ88="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.3-beta.0_1545399262774_0.7832292428860659"},"_hasShrinkwrap":false},"4.0.3":{"name":"@modular-toolkit/hocs","version":"4.0.3","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.3","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <5.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"56f4758a4764b98c3770d2d08316c23d9bf638fe","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.3.tgz","_id":"@modular-toolkit/hocs@4.0.3","_npmVersion":"6.4.1","_nodeVersion":"8.9.4","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-IaL9yDTLRORi8hkqjhAIgFYs+VNPUHuYOkQhbgBHbRMJ0/OA9xnZyOxLllqFOaTecB9dqgrkYWdHqq6zU795nQ==","shasum":"8987efa9320bd0c7511d1f9e7508a63998061b87","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.3.tgz","fileCount":28,"unpackedSize":46108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcI3R4CRA9TVsSAnZWagAAYsQP/iYI/fLhz++jIl6y1UHF\nZepvSqykK56t+E6hyTqoDC/tFCeJu1ejmV4OjpX/MI9LVrSWH+UNbN+abdWu\ni62S2UcJXenUAAkQFHSKlANybHBkfW6hEih53fVQYhZvHo9hes2mSV3wWPBM\nOcq8p22g4nGLJgdVAm37aLvQ/zAECKaUaq2bJeS9PRYfzZNELarYa6RrgaiS\nvyLKoARvaw7BffSZLL/ruVB7osZz8679x1apxreQVihT9G7JVryZ5OIGwBxe\nOAptBJkkgIQNnbGJOk7OnrO2Ozsog9KViwInV54gdVq5jw4nBRGE355LIWgk\n9ZQWKfqMiVBnkkggjbq6WuskJ2VU3NE/BRa1IMvuDjEBMR3kGKj+CwujWWEa\nQpMi8jSWUHI2DHJBNZp93lTekc6/O3S0sKH+1Auz1BTFWd1YpgsHsVQmaAAY\nkFFRhXIP5HlIEpMWAnQMOOPY8A6KYMBUzaePncjdpmI/6F9JuUHFcx6CIldS\nb+GXvINmPLrKeY19MfHs4+j6mfdskpJZRuxRsu9BGlCfk+y8KivVx9A7QJuN\nnDptxBMHU9bL9qSSFV5vIkmbbwgssmZbKcA21QF/fWOJ+dHpTzO0EUPoLFyE\nFYrAf2Qr1jtNzPBiBbvle1vudXyzQhCrDNlw2aNvbqTOMLFk2JkiZ4889rBV\nipAb\r\n=MXfc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaIQ785J28XdB1KucYXgkkt1dZVYmkls5jFVhyVubRMQIhAJ1ujZIAGQXsCQ1vWtolHLY0LWTRYhcBM23tRmWB39YC"}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.3_1545827448159_0.4668845202934895"},"_hasShrinkwrap":false},"4.0.4-beta.1":{"name":"@modular-toolkit/hocs","version":"4.0.4-beta.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.4-beta.1","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <5.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"fa9f97325e1da9ef496c7521711afca719efe186","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.4-beta.1.tgz","readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for executing code on `componentDidMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentDidMount({ foo }) {\n        someCallback(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someCallback(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@4.0.4-beta.1","_npmVersion":"6.5.0","_nodeVersion":"8.10.0","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-rFwUJNjOkSrAZjWuXROLJurmHUR2exVJjnuB7TLZ1xQm0B0OUfWDuPUParz7WE9mAk3gEC9TJ+TxbeTCovqvPg==","shasum":"91da212c03bf2db786e99e91c244c401447aeff7","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.4-beta.1.tgz","fileCount":28,"unpackedSize":46122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcL0pRCRA9TVsSAnZWagAAJAIP/1qNEG7+XnIlPbUtOhG+\nOvadWsBR3YaIZpjE6pg6A/1fEeTWo+d+D7S1k/Q0aHOY19BttkLQIuwKC6mU\n7TbsNejTWfEHJ13sNTQZMMlIpCXK4VmelCghLfyGm9HPhG+XFRmGUW9/K+OQ\nFhDz0mC2YzVGeAkxipo4Wt2+pV1dvshcUo2XT8aode20+1EXI+bX7eoKdG2x\nbciLiCuikrNdR9mUpcYONNizlAysldbUWnvG1w/86pkzse32+rZwefWzKBbJ\nHa1BmVlQXYiQtiRmpYXVhU3lSsPA9CR+cUskTdI6zRmn+T9ZCV+LNPqO8OfF\niXkwJBeRf2Hbq3TSb0aMg2Vd5CAjNyBeOscZ3ZPT2vwvnhclNWxhhlXR1S/D\nqRMYyXloqNGq5HzoGjSHIppm7ZENBzfqFF/WJrkVWcztq/Yqh19/RpmWue59\nAPURjb6969jXNVf+M5R23hOnzVcmf0HMR7Bk2IrToOZp84WnEhgLT6QbJODm\nZPFvZwXYefCCJOIisSsUzjCvNwdvSNDTsc3JZfKZp+WYhRRnDahnvA1IFdd2\nd3kzgYuppzWhX8MwMdhrELc+sw7IoE8OJetJRBcn3eK2/b4FDgMW7afpvvRd\ntHSirHOSRR4lwus7F+RwBZLh9B7MRnBweytg+kBWivLk/OfNB5gqD7B3lsje\nSmz8\r\n=o8es\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1csjrjy9qnjIqIv1M/XBvFGMg7CZi20i8SinEazOTggIhAPrHSIDP3gSopevgY6jTITWObjIKsJRIW8rpIXtiGiS2"}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.4-beta.1_1546603088501_0.3169116383172541"},"_hasShrinkwrap":false},"4.0.4":{"name":"@modular-toolkit/hocs","version":"4.0.4","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"@modular-toolkit/selectors":"^3.0.4","lodash.debounce":"^4.0.8"},"peerDependencies":{"prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <5.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"a66d7fa69d4c8820d60eaf769210ecadfd057cda","_resolved":"","_integrity":"","_from":"file:modular-toolkit-hocs-4.0.4.tgz","_id":"@modular-toolkit/hocs@4.0.4","_npmVersion":"6.5.0","_nodeVersion":"8.10.0","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-r5zb9ViBJFFgV76a4F3xSxgbsmvTVpZ9Xesa+q8PtA0QY5zqovgstYp2hnQwEw/SiG1xGRptFqCIrp17dZcrmA==","shasum":"73c740024a7af52efb8903d4219d6800bb4c49ba","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-4.0.4.tgz","fileCount":28,"unpackedSize":46108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMygOCRA9TVsSAnZWagAAvCUP/3Dgpf38OD/BzfU0eo2I\nSu6Ir08x+KCdcSRmyRdWSeidKVmP9p1AmZ3MgTPr81taMRfgQlS/Ijp7ydIl\n6P50nHrWskRytpcvV9YRNVdI1quFyWXstWMMpm/BjM1wIM19imdfUAa2+gDS\nQhGvzuzmgZY0DyIV1Y0uhf7lXMOLsPboYAdWFsSFwHrB9mCBAzX9TeB35mc9\npyLXDlMWgEC4/kmZzex2q0szIx5hSqUhDEV4deNcTjyZs4ArgnjgW5RYClEG\n65uqB2EOaz1+ozJ9LeeDyhFyBh6GaMSYnsS+PPzU/PjdvpU1Bn7LntsQ9XtO\nQqgyATfDfHFb8AGtU/uq4MURAEjdsbgdH7+/mYoHfraZzt5gkVOQZpiiLH7/\nMQwsW8A1ePvFaR1WYJ0W9oASzOUAlaSmQnf+D/g2bBGWXmxOTjAE6gAtNpxf\n+V53xQ+J5IMPQttqRoSGOXGGRsn2YoqpsXTOZIl6lTJEs47XrI5oXTmKSinu\nWmvEEPWkE4vo7PQmlSH01Wm+L4yhmAP7F4dtdurUJ+Azrqzvxx+imY7a0bKb\nFNqHo2CdIIs8yu58ooHZ+s45H6ExlndfUDYme1n9BUEZPQhCgyCcaHzoSq+i\n3Vk2z+6QvZVP9jBbPRCSOuCn8vqB0MpameVSSTKn/1lA4fxb5aGd1+DlEp5d\nUiFd\r\n=qgg2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0uOTdfAuNIlJ3ST2k1spp3X6VO81OvZUmTxu4KL3d1AiEAwXP3/48YNlrbKH2Bifvs3UVMrjTkdNq3hTQw0uflzw4="}]},"maintainers":[{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_4.0.4_1546856461460_0.4868387896931212"},"_hasShrinkwrap":false},"5.0.0-beta.0":{"name":"@modular-toolkit/hocs","version":"5.0.0-beta.0","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"lodash.debounce":"^4.0.8"},"peerDependencies":{"@modular-toolkit/selectors":">=3.0.0 <4.0.0","prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <5.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"a7f8fa78f62d29c8d424701b329402e99f400ec2","readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for executing code on `componentDidMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentDidMount({ foo }) {\n        someCallback(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someCallback(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@5.0.0-beta.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (darwin)","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-U2ZtPLBE+7Nc6xghCY26UjctkJ0ayECdimkHEwKl0HQFglVTq5mceq7Ugmq4VJ5/x5G+SClQBjtAwaoyjJYc8w==","shasum":"8b466e0f40490752e720ebc15a1ed8715df66aff","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-5.0.0-beta.0.tgz","fileCount":28,"unpackedSize":46409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrhJaCRA9TVsSAnZWagAAIdIP/0c24XeKv4smwiYLO+QK\nG23YFkOm5eASrFrVb5rCzo5+/HpUZPL+qyxTSV7gqDWvEht4aEOjgLaouL6l\nuPEkea4Qj1nIKu7bJdmcnGzhAHNkTpKgDXFjsHl9Xljyp2jwu9h916CHaNxY\nYVOh5g3u6eKwAcgUp5c9VseEokwkb12OrwEy7nP1PG3MliSd3x7bOFao2cR7\ne1PhizpQCzwuNv6V73T8CjSOEH1BwtbtmTYGtbCmw20Jm9xXz5vRZiFlLCmv\nHuLeIiAqaQeV+g4YXwen/6b7/lCIZ7wKOCmJoU5WL1Hgf7lE7e++V7A/zOgq\ncqxAuAh5Sy5AOkon06+d5dVE4CN4+HWsV/Dbuaox0G2/RZAZxiK87UME8kIg\nVhfe1Rsdz6ykAAZ4Nw+mZV0aX87EKP4s8HDpBtVCR15c959eWWMG6E0syPrw\nPjbmgFPpPc+fftUbqiMV7JSoN7YSjBGyVhdExg6s8AeYQnxxjvImBdyjw12q\nqT2MU22ZBHA0CIqU8jR5DHc6tZJaZqMDR6cnrlIJeXUFzb/T9Ht61Z8bWgKI\nkeRV8DlG9xHh1WPmu1vjrQT54Ivw5Ujp5AcXxGK2NvR6LFod8brJBIccq4dy\nCUbZc0g6x9fUZQEOgmm/adS/daUfTa4bAkwuZ72ZH8TtI9aIzoYC0nJTJZ2e\n+1TL\r\n=/E9P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPu4+Nr/yg2q9ODzGAY5USMORTDjcFDUUOZLL0Efzx9AiEAkZrBJIgZAnYqaz9mXrzTOVSR4XV3vlilykMlaDAOjTI="}]},"maintainers":[{"email":"dpavicic@ebay.com","name":"dpavicic"},{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_5.0.0-beta.0_1554911833732_0.9094228781373437"},"_hasShrinkwrap":false},"5.0.0-beta.1":{"name":"@modular-toolkit/hocs","version":"5.0.0-beta.1","description":"Higher order components (HoCs) for connecting modules","esnext":"index-esnext.js","main":"index.js","sideEffects":false,"scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"license":"MIT","dependencies":{"lodash.debounce":"^4.0.8"},"peerDependencies":{"@modular-toolkit/selectors":">=3.0.0 <4.0.0","prop-types":"<16.0.0","react-redux":">=5.0.0 <6.0.0","recompose":">=0.26.0 <1.0.0","redux-saga":">=0.15.0 <1.0.0","reselect":">=3.0.0 <5.0.0"},"devDependencies":{"@modular-toolkit/selectors":"4.0.0-beta.2","babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"^1.6.1","webpack":"^4.20.2","webpack-cli":"^3.1.2"},"gitHead":"b6843629e7daaf2ee8973919ad554e5d739c44c2","readme":"# hocs\n\nReact higher order components to make working with [Redux](https://redux.js.org/) and \n[Recompose](https://github.com/acdlite/recompose) easier.\n\n## Installation\n\n    npm install --save @modular-toolkit/hocs\n\n**Note:** by default, the npm package exposes ES5-compatible code (transpiled through Babel).\n\nIf you want to use the untranspiled code (highly recommended), us the *esnext* version, which is\nincluded in the same npm package ([more info here](http://2ality.com/2017/06/pkg-esnext.html)).\n\n## API\n\n### [bootstrap](src/bootstrap.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for executing code on `componentDidMount`.\nJust reduces some boilerplate:\n\n```javascript\nlifecycle({\n    componentDidMount({ foo }) {\n        someCallback(foo);\n    }\n});\n```\n\n…can now be written as:\n\n```javascript\nimport { bootstrap } from '@modular-toolkit/hocs';\n\nbootstrap(({ foo }) => someCallback(foo));\n```\n\n### [callHandlerOnResize](src/callHandlerOnResize.js)\n\n\n[Recompose](https://github.com/acdlite/recompose) helper that allows to subscribe to window resize events.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { callHandlerOnResize } from '@modular-toolkit/hocs';\n\ncompose(\n    withHandlers({\n        doSomething: () => () => console.log('window was resized')\n    }),\n    callHandlerOnResize('doSomething')\n);\n```\n\nAccepts a debounce option, that will debounce the call of the handler.\n\n### [connectSelectors](src/connectSelectors.js)\n\nHelper function for connecting selectors to props using `makeWorkWithGlobalState`\nfrom [@modular-toolkit/selectors](../selectors/README.md).\n\nJust reduces some boilerplate:\n\n```javascript\nconnect(state => ({\n   foo: getFoo(state),\n   bar: getBar(state)\n}));\n```\n\ncan now be written as:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    foo: getFoo,\n    bar: getBar\n});\n```\n\nIt also works with nested states props:\n\n```javascript\nimport { connectSelectors } from '@modular-toolkit/hocs';\nconnectSelectors({\n    car: {\n        color: getCarColor,\n        ownerName: getUserName\n    }\n});\n```\n\nThis will create a prop `car` with the properties `color` and `ownerName`.\n\n### [onLocationChanged](src/onLocationChanged.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function that calls a callback whenever the location pathname or location search changes.\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Location has changed'))\n```\n\nBy default, the provided callback will only be invoked when the location changes, but not when the page is rendered\ninitially.\n\nYou can pass a boolean flag as second argument to change this behavior:\n\n```javascript\nimport { onLocationChanged } from '@modular-toolkit/hocs';\nonLocationChanged(props => console.log('Page was loaded or location has changed'), true)\n```\n\n\n### [provideContext](src/provideContext.js)\n\nRecompose helper that works similar to `withContext`, except that it also provides a\n`subscribe` method that child components can use to get notified about context changes.\n\nBest used in conjunction with `subscribeToContext`.\n\nExample:\n\n```javascript\nimport { compose, withProps } from 'recompose';\nimport { provideContext, subscribeToContext } from '@modular-toolkit/hocs';\n\nconst ThemeProvider = compose(\n   provideContext('theme', {\n       backgroundColor: PropTypes.string,\n       textColor: PropTypes.string\n   }, props => {\n       if (props.desiredColors === 'green') {\n           return {\n               backgroundColor: 'lightGreen',\n               textColor: 'darkGreen'\n           }\n       } else {\n           return {\n               backgroundColor: 'white',\n               textColor: 'black'\n           }\n       }\n   })\n)(/* … */);\n\nconst ThemeableInput = compose(\n    subscribeToContext('theme', {\n        backgroundColor: PropTypes.string,\n        textColor: PropsTypes.string\n    }),\n    withProps(({ backgroundColor, textColor}) => {\n        console.log('Those color props are from ThemeProvider:', backgroundColor, textColor);\n    })\n)(/* … */);\n```\n\n### [subscribeToContext](src/subscribeToContext.js)\n\nUsed in conjunction with `subscribeToContext`, see code example above.\n\n### [withRefs](src/withRefs.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper function for allowing children to pass element refs to a higher\norder component (HOC).\n\nSimply include `withRefs()` in the `compose` call of the HOC.\n\n```javascript\nimport { compose } from 'recompose';\nimport { withRefs } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withRefs(),\n    /* … */\n)(/* … */);\n```\n\nThis will add the `setRef` property to the child.\n\nIf the child calls the function like this:\n\n```javascript\n<img ref={setRef('myImage')} />\n```\n\n…then the HOC can access the element via `refs.myImage`;\n\n### [withUpdatableState](src/withUpdatableState.js)\n\nRecompose Helper function that behaves exactly like `withState`, except that it also\nprovides a state patching function.\n\nExample:\n\n```javascript\nimport { withState } from '@modular-toolkit/hocs';\nimport { withProps } from 'recompose';\n\nwithState('car', 'setCar', 'updateCar', () => ({\n    color: 'red',\n    maxSpeed: 240,\n}));\n\nwithProps(({ car, setCar, updateCar }) => {\n    updateCar({ color: 'blue' });\n\n    // the above is the same as\n    setCar({\n       ...car,\n       color: 'blue'\n    });\n});\n```\n\nThe nice thing is, that you don't need the state and the `setState` function in order\nto modify the state. Just using the `updateState` function is enough.\n\n### [withWindowSize](src/withWindowSize.js)\n\n[Recompose](https://github.com/acdlite/recompose) helper that adds the the window size to props.\nThis is handy, because it triggers a `componentWillReceiveProps` whenever the window resizes.\n\nExample:\n\n```javascript\nimport { compose } from 'recompose';\nimport { withWindowSize } from '@modular-toolkit/hocs';\n\nconst Hoc = compose(\n    withWindowSize(),\n    withProps(({ windowSize }) => console.log('the window is that wide:', windowSize.width))\n);\n```\n\n## Change Log\n\n* See [CHANGELOG.md](CHANGELOG.md)\n\n## Contribution Guidelines\n\n* See [CONTRIBUTING.md](../../CONTRIBUTING.md)\n\n## License\n\n[MIT licensed](LICENSE)\n\nCopyright © 2018 mobile.de GmbH\n","readmeFilename":"README.md","_id":"@modular-toolkit/hocs@5.0.0-beta.1","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (darwin)","_npmUser":{"name":"pahund","email":"pahund@team.mobile.de"},"dist":{"integrity":"sha512-NbkZmhSOedqeSK8mF+JiKaZmn8K78X017k6+Wyc23IRitIdtGpEEwUwccWsGrLajKylal4kriSi38QL6s5yiXA==","shasum":"cbb9e57e1115c3aaf556fc3fc9e6679fd4b97ac6","tarball":"https://registry.npmjs.org/@modular-toolkit/hocs/-/hocs-5.0.0-beta.1.tgz","fileCount":28,"unpackedSize":46206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczrU3CRA9TVsSAnZWagAA/Q0P/jhGmePK05vVCTVPeH3h\nSCd+lXT1CNm/bxW4vSjU5A9VPrgEIUKzkXyot4Y7fI0O66RNohttAURpCpxK\nyTsRySONUDsHswlUPC5CAGBFyO1BIfzERQrxCMqEA4puHiMSiH8RDnr1QYvk\nz1yWAZwQDCXNyGUCxktTd9a5Do86zxWSRilucXThRiMHLNIW72gAnBmzFbvg\nBlVDhwiqrcA2vXmaoBYGfZHo4pfjr3quzEh1xP6JbqVxjfmgmKH74RHeg5aV\naXljP+rk0HMeAXDfWgRS/diJTIQECazIqQj3h2KLsIN9IjAFuiwXdmjhDzwX\nKXrsPGmFpzyAR+5zmMl9w90G4K2mDrdP7Lw2+48WsjCJRIrQl0mqQgsFsxe8\nQrFq82apbWswFrn9iyune8MOZlymH91+GhHWDpwq6Fy4pzCvwTTQN0/2z4RP\nsPfLaXWg5ozva0pL0oaKOdBkUxybOL8nxiuxafu4hkjEivI0d8OpdLTNfZZM\n+cjmRURZ53JXHBH32DRQOrsIE4xumNFHPZhBwBEja1gwrr12mroolMave7xV\nocRmvTdLwNbCLcvS7Q+VjKHGZDheiZrF0dYwpaoVMeiVxmaP/1at/2NTfWvS\nFCF/I5OW/BOWftj1cHp8IL60AJCM0viP1Plunm41Zf+B9dLjg/upszbLOKl5\n0U9v\r\n=spYI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9s3FQFzQb0lE7Ld1evJTPHvJhEoE+h2HH7MYlxwbpGAiAGgEblOYp3R3t7HiKSJ1+YtXMf1+V1IZHpalO9upbJ2Q=="}]},"maintainers":[{"email":"dpavicic@ebay.com","name":"dpavicic"},{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hocs_5.0.0-beta.1_1557050678749_0.9779562446874976"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-09T13:03:52.235Z","1.0.2":"2018-03-09T13:03:52.381Z","modified":"2022-04-06T06:11:34.137Z","2.0.0-beta.0":"2018-03-14T10:51:24.335Z","2.0.0-beta.1":"2018-03-14T13:56:07.213Z","2.0.0":"2018-03-14T14:00:56.158Z","2.1.0-beta.1":"2018-03-19T09:29:08.078Z","2.1.1":"2018-03-19T10:10:02.356Z","3.0.0":"2018-04-05T09:36:43.500Z","3.1.0-beta.2":"2018-09-25T08:28:49.928Z","3.1.1":"2018-09-25T14:43:15.873Z","3.1.2":"2018-09-25T14:44:20.027Z","3.1.3":"2018-10-09T12:20:28.038Z","4.0.0-alpha.0":"2018-10-17T08:55:35.486Z","4.0.0":"2018-10-17T10:13:50.941Z","4.0.1":"2018-10-25T07:42:21.711Z","4.0.2":"2018-10-31T10:12:45.052Z","4.0.3-beta.0":"2018-12-21T13:34:23.037Z","4.0.3":"2018-12-26T12:30:48.276Z","4.0.4-beta.0":"2019-01-04T10:03:01.503Z","4.0.4-beta.1":"2019-01-04T11:58:08.670Z","4.0.4":"2019-01-07T10:21:01.639Z","5.0.0-beta.0":"2019-04-10T15:57:13.892Z","5.0.0-beta.1":"2019-05-05T10:04:38.902Z"},"maintainers":[{"email":"dpavicic@ebay.com","name":"dpavicic"},{"email":"jay.maass@gmail.com","name":"ninja.maass"},{"email":"pahund@team.mobile.de","name":"pahund"}],"description":"Higher order components (HoCs) for connecting modules","contributors":[{"name":"Ninja Maaß","email":"jmaass@team.mobile.de"},{"name":"Daniel Schäfer","email":"danschaefer@team.mobile.de"}],"author":{"name":"Patrick Hund","email":"pahund@ebay.com"},"license":"MIT","readme":"","readmeFilename":""}