{"id":17172657,"url":"https://github.com/jsonnull/react-routine","last_synced_at":"2025-06-15T14:38:47.631Z","repository":{"id":57343927,"uuid":"121578590","full_name":"jsonnull/react-routine","owner":"jsonnull","description":"Easy stateful React components","archived":false,"fork":false,"pushed_at":"2018-05-15T00:22:24.000Z","size":171,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-14T23:53:48.783Z","etag":null,"topics":["react"],"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/jsonnull.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-02-15T00:50:37.000Z","updated_at":"2022-03-02T21:05:44.000Z","dependencies_parsed_at":"2022-09-16T02:50:44.529Z","dependency_job_id":null,"html_url":"https://github.com/jsonnull/react-routine","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jsonnull/react-routine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsonnull%2Freact-routine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsonnull%2Freact-routine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsonnull%2Freact-routine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsonnull%2Freact-routine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsonnull","download_url":"https://codeload.github.com/jsonnull/react-routine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsonnull%2Freact-routine/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259991129,"owners_count":22942565,"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"],"created_at":"2024-10-14T23:37:36.542Z","updated_at":"2025-06-15T14:38:47.445Z","avatar_url":"https://github.com/jsonnull.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Routine\n\n[![Build Status](https://travis-ci.org/jsonnull/react-routine.svg?branch=master)](https://travis-ci.org/jsonnull/react-routine)\n[![Coverage Status](https://coveralls.io/repos/github/jsonnull/react-routine/badge.svg?branch=master)](https://coveralls.io/github/jsonnull/react-routine?branch=master)\n[![npm version](https://img.shields.io/npm/v/react-routine.svg)](https://www.npmjs.com/package/react-routine)\n\nA simple alternative API for writing stateful React\ncomponents. With it you can:\n\n- Simplify data flow in components through chronological execution\n- Declare explicity when you expect lifecycle events and callbacks \n- Write components that are short and easy to reason about\n\n**Note**: `react-routine` is currently unstable, expect some breaking changes\n\n## Installation\n\n```sh\nyarn add react-routine\n\n# npm install --save react-routine\n```\n\n### Example Script\n\n```JavaScript\nimport React from 'react'\nimport { routine, setState, componentWillMount, createHandlers } from 'react-routine'\n\nconst controller = function*() {\n  // Get the initial props\n  const initial = yield componentWillMount()\n\n  // Set the initial sate\n  yield setState({ value: initial.props.value })\n\n  // Create a change handler we can listen to\n  const { handlers } = yield createHandlers({ onChange: e =\u003e e.target.value })\n\n  while (true) {\n    // Wait for change handler\n    const { result } = yield handlers.onChange\n    // Set the new state\n    yield setState({ value: result })\n  }\n}\n\nconst Input = props =\u003e \u003cinput onChange={props.onChange} value={props.value} /\u003e\n\nexport default routine(controller)(Input)\n```\n\n## Documentation\n\n - [Getting Started](docs/getting-started.md)\n\n## Examples\n\n - Basic ([source](examples/))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsonnull%2Freact-routine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsonnull%2Freact-routine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsonnull%2Freact-routine/lists"}