{"id":17736598,"url":"https://github.com/parro-it/redux-submitform-onchange","last_synced_at":"2025-03-31T19:17:04.933Z","repository":{"id":57351710,"uuid":"52102491","full_name":"parro-it/redux-submitform-onchange","owner":"parro-it","description":null,"archived":false,"fork":false,"pushed_at":"2016-03-02T08:32:15.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-20T01:48:57.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/parro-it.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":"2016-02-19T16:55:06.000Z","updated_at":"2019-07-09T11:52:16.000Z","dependencies_parsed_at":"2022-09-26T16:40:39.404Z","dependency_job_id":null,"html_url":"https://github.com/parro-it/redux-submitform-onchange","commit_stats":null,"previous_names":["parro-it/redux-submitform-onvalidation"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fredux-submitform-onchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fredux-submitform-onchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fredux-submitform-onchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fredux-submitform-onchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parro-it","download_url":"https://codeload.github.com/parro-it/redux-submitform-onchange/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523847,"owners_count":20791444,"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":[],"created_at":"2024-10-26T00:23:39.812Z","updated_at":"2025-03-31T19:17:04.894Z","avatar_url":"https://github.com/parro-it.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-submitform-onvalidation\n\n\u003e Automatically submit a [redux-form](https://github.com/erikras/redux-form) every time\n\u003e it validate succesfully, but no more than once in a while.\n\n\n[![Travis Build Status](https://img.shields.io/travis/parro-it/redux-submitform-onvalidation.svg)](http://travis-ci.org/parro-it/redux-submitform-onvalidation)\n[![NPM module](https://img.shields.io/npm/v/redux-submitform-onvalidation.svg)](https://npmjs.org/package/redux-submitform-onvalidation)\n[![NPM downloads](https://img.shields.io/npm/dt/redux-submitform-onvalidation.svg)](https://npmjs.org/package/redux-submitform-onvalidation)\n\n## Installation\n\n```bash\nnpm install --save redux-submitform-onvalidation\n```\n\n## Usage\n\nPlease refer to the [redux-form](http://erikras.github.io/redux-form/#/examples/synchronous-validation?_k=95xd6r).\n\n```javascript\n  const submitOn = require('redux-submitform-onvalidation');\n\n  const validate = values =\u003e {\n    const errors = {};\n    if (!values.username) {\n      errors.username = 'Required';\n    } else if (values.username.length \u003e 15) {\n      errors.username = 'Must be 15 characters or less';\n    }\n    return errors;\n  };\n\n  ...\n\n  // this is how you normally validate a redux-form\n  export default reduxForm({\n    form: 'synchronousValidation',\n    fields,\n    validate\n  })(SynchronousValidationForm);\n\n\n  // instead, to enable submit on validation:\n\n  const validateAndSubmit = submitOn(validate);\n\n  const form = reduxForm({\n    form: 'tunnel',\n    fields,\n    validate: validateAndSubmit.validate\n  }, mapStateToProps )(EditTunnel);\n\n  validateAndSubmit.formToSubmit(form);\n\n```\n\n## License\n\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 parro-it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Fredux-submitform-onchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparro-it%2Fredux-submitform-onchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Fredux-submitform-onchange/lists"}