{"id":28300470,"url":"https://github.com/shakogegia/recompose-utils","last_synced_at":"2026-05-09T09:43:23.621Z","repository":{"id":57349260,"uuid":"142063591","full_name":"shakogegia/recompose-utils","owner":"shakogegia","description":"Utilities for React Recompose","archived":false,"fork":false,"pushed_at":"2018-11-15T08:28:33.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T19:48:17.106Z","etag":null,"topics":["react","react-native","reactjs","recompose"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakogegia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-23T20:05:35.000Z","updated_at":"2022-05-13T00:11:44.000Z","dependencies_parsed_at":"2022-08-29T17:21:00.936Z","dependency_job_id":null,"html_url":"https://github.com/shakogegia/recompose-utils","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shakogegia/recompose-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakogegia%2Frecompose-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakogegia%2Frecompose-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakogegia%2Frecompose-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakogegia%2Frecompose-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakogegia","download_url":"https://codeload.github.com/shakogegia/recompose-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakogegia%2Frecompose-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260251394,"owners_count":22981028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-native","reactjs","recompose"],"created_at":"2025-05-23T17:24:08.667Z","updated_at":"2026-05-09T09:43:23.574Z","avatar_url":"https://github.com/shakogegia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recompose utilities\n\n`withEvents`, `withValidation` for react recompose\n\ninstall\n```\nnpm i recompose-utils\n```\nor \n```\nyarn add recompose-utils\n```\n\n### withEvents\n\nimport withEvents\n\n```js\nimport { withEvents } from \"recompose-utils\"\n```\n\nand than you have emmiters and handlers\n\nyou can pass `withEvents` to composed component where you want to emitt event\n\n```jsx\n  withEvents({\n    emitters: ['toggleAuthModal'],\n  }),\n```\nnow you have `emitters` prop to your component and you can fire event like this\n\n```jsx\n  \u003cbutton onClicl={() =\u003e props.emitters.toggleAuthModal('hi from here') }\u003e\n    fire event\n  \u003c/button\u003e\n```\n\n\nand you pass `withEvents` to composed component where you want to listen to that event\n\n\n```jsx\n  withEvents({\n    handlers: {\n      toggleAuthModal: (props) =\u003e (event) =\u003e {\n        console.log(\"event:: toggleAuthModal -fired with data::\", event)\n      },\n    },\n  }),\n```\n\n### withValidation\n\nimport withValidation\n\n```jsx\nimport { withValidation } from recompose-utils\n```\n\nyou can pass `withValidation` to composed component with wurles\n\n```jsx\n  withValidation({\n    name: {\n      rules: \"required\",\n      messages: {\n        required: \"This field is required\"\n      }\n    },\n    email: {\n      rules: 'require|email',\n      messages: {\n        require: \"This field is required\",\n        email: \"Please, fill with valid email\"\n      }\n    },\n  }),\n```\n\nand you can validate you form like \n```jsx\n  withHandlers({\n    handleSave: (props) =\u003e () =\u003e {\n      const isValid = validate(props.formData) // returnes true or false\n    },\n  }),\n\n```\n\nand you can access your errored filds in `errors` props\nerror props would be something like this\n\n```jsx\n  errors: {\n    name: \"\",\n    email: \"Please, fill with valid email\"\n  }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakogegia%2Frecompose-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakogegia%2Frecompose-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakogegia%2Frecompose-utils/lists"}