{"id":17948856,"url":"https://github.com/rafde/react-hook-use-cta","last_synced_at":"2026-02-28T07:34:06.215Z","repository":{"id":224666040,"uuid":"757737009","full_name":"rafde/react-hook-use-cta","owner":"rafde","description":"A React hook for managing complex state with custom actions, history tracking, and type safety.","archived":false,"fork":false,"pushed_at":"2025-03-18T08:01:22.000Z","size":2082,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T05:07:05.680Z","etag":null,"topics":["hooks-api-react","javascript-library","react","react-hooks","reactjs","typescript-react"],"latest_commit_sha":null,"homepage":"https://rafde.github.io/react-hook-use-cta/","language":"TypeScript","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/rafde.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-14T21:45:45.000Z","updated_at":"2025-02-11T20:06:47.000Z","dependencies_parsed_at":"2024-05-17T07:36:44.168Z","dependency_job_id":"c671eb63-68d4-47bd-b806-3c91a2276391","html_url":"https://github.com/rafde/react-hook-use-cta","commit_stats":null,"previous_names":["rafde/react-hook-use-cta"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafde%2Freact-hook-use-cta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafde%2Freact-hook-use-cta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafde%2Freact-hook-use-cta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafde%2Freact-hook-use-cta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafde","download_url":"https://codeload.github.com/rafde/react-hook-use-cta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366205,"owners_count":20603438,"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":["hooks-api-react","javascript-library","react","react-hooks","reactjs","typescript-react"],"created_at":"2024-10-29T09:10:23.124Z","updated_at":"2026-02-28T07:34:06.203Z","avatar_url":"https://github.com/rafde.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-hook-use-cta: useCTA (use Call To Action)\n\n[![NPM License](https://img.shields.io/npm/l/react-hook-use-cta)](/LICENSE)\n[![NPM Version](https://img.shields.io/npm/v/react-hook-use-cta)](https://www.npmjs.com/package/react-hook-use-cta)\n[![JSR Version](https://img.shields.io/jsr/v/%40rafde/react-hook-use-cta)](https://jsr.io/@rafde/react-hook-use-cta)\n![Test](https://github.com/rafde/react-hook-use-cta/actions/workflows/test.yml/badge.svg)\n![Lines](./site/public/badges/coverage-lines.svg)\n\nRead full document for `react-hook-use-cta` on [documentation website](https://rafde.github.io/react-hook-use-cta)\n\n## Install\n\n```bash\nnpm i react-hook-use-cta\n```\n\n```bash\nyarn add react-hook-use-cta\n```\n\n```bash\ndeno add jsr:@rafde/react-hook-use-cta\n```\n\n## useCTA\n\n```tsx\nimport { useCTA, } from 'react-hook-use-cta';\n```\n\n```tsx\nconst [\n\thistory,\n\tdispatch\n] = useCTA({\n\tinitial: {\n\t\tvalue: 0,\n\t},\n});\n```\n\n## createCTA\n\n```tsx\nimport { createCTA, } from 'react-hook-use-cta';\n\nconst [\n\thistory,\n\tdispatch\n] = createCTA({\n\tinitial: {\n\t\tvalue: 0,\n\t},\n});\n```\n\n\n## createCTAContext\n\n```tsx\nimport { createCTAContext, } from 'react-hook-use-cta';\n\nconst context = createCTAContext({\n\tinitial: {\n\t\tvalue: 0,\n\t},\n});\n\nexport const CTAProvider = context.CTAProvider;\nexport const useCTAHistoryContext = context.useCTAHistoryContext;\nexport const useCTADispatchContext = context.useCTADispatchContext;\n```\n\n## createCTASelector\n\n```tsx\nimport { createCTASelector, } from 'react-hook-use-cta';\n\nexport const useCTASelector = createCTASelector({\n\tinitial: {\n\t\tvalue: 0,\n\t},\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafde%2Freact-hook-use-cta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafde%2Freact-hook-use-cta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafde%2Freact-hook-use-cta/lists"}