{"id":15412766,"url":"https://github.com/jeetiss/ucs","last_synced_at":"2025-08-02T15:40:34.514Z","repository":{"id":57384895,"uuid":"171031782","full_name":"jeetiss/ucs","owner":"jeetiss","description":"another controlled state hook","archived":false,"fork":false,"pushed_at":"2019-02-18T10:03:18.000Z","size":960,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T12:03:46.867Z","etag":null,"topics":["controlled","hooks","react","state","uncontrolled"],"latest_commit_sha":null,"homepage":"https://jeetiss.github.io/ucs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeetiss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-16T17:35:09.000Z","updated_at":"2024-04-24T12:03:46.868Z","dependencies_parsed_at":"2022-09-05T06:21:53.369Z","dependency_job_id":null,"html_url":"https://github.com/jeetiss/ucs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeetiss%2Fucs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeetiss%2Fucs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeetiss%2Fucs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeetiss%2Fucs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeetiss","download_url":"https://codeload.github.com/jeetiss/ucs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249685215,"owners_count":21310567,"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":["controlled","hooks","react","state","uncontrolled"],"created_at":"2024-10-01T16:54:17.419Z","updated_at":"2025-04-19T11:37:34.958Z","avatar_url":"https://github.com/jeetiss.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ucs\n\n\u003e another controlled state hook\n\n[![NPM](https://img.shields.io/npm/v/ucs.svg)](https://www.npmjs.com/package/ucs) [![bundlephobia](https://img.shields.io/bundlephobia/minzip/ucs.svg?style=flat)](https://bundlephobia.com/result?p=ucs) [![travis](https://img.shields.io/travis/com/jeetiss/ucs.svg?style=flat)](https://travis-ci.com/jeetiss/ucs/)\n\n## Install\n\n```bash\nnpm install ucs\n```\n\n## Usage\n\n```jsx\nimport React from \"react\";\nimport useControlledState from \"ucs\";\n\nconst Toggler = ({ value, onChange, defaultValue }) =\u003e {\n  const [state, setState] = useControlledState(() =\u003e value || defaultValue);\n\n  return (\n    \u003cbutton onClick={() =\u003e setState(!state)}\u003e{state ? \"on\" : \"off\"}\u003c/button\u003e\n  );\n};\n```\n\n## demo\n\nsee demo and example of usage on [gh-pages](https://jeetiss.github.io/ucs/)\n\n## License\n\nMIT © [jeetiss](https://github.com/jeetiss)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeetiss%2Fucs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeetiss%2Fucs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeetiss%2Fucs/lists"}