{"id":13450938,"url":"https://github.com/bboydflo/use-value-after","last_synced_at":"2025-11-07T01:04:12.491Z","repository":{"id":47961714,"uuid":"212820878","full_name":"bboydflo/use-value-after","owner":"bboydflo","description":"dead simple react hook to get the next value from an array after a specific delay ","archived":false,"fork":false,"pushed_at":"2023-01-04T22:11:09.000Z","size":364,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-18T02:14:47.741Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bboydflo.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-10-04T13:26:38.000Z","updated_at":"2023-03-04T06:10:11.000Z","dependencies_parsed_at":"2023-02-02T21:31:42.128Z","dependency_job_id":null,"html_url":"https://github.com/bboydflo/use-value-after","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboydflo%2Fuse-value-after","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboydflo%2Fuse-value-after/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboydflo%2Fuse-value-after/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboydflo%2Fuse-value-after/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bboydflo","download_url":"https://codeload.github.com/bboydflo/use-value-after/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254595389,"owners_count":22097546,"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-07-31T07:00:40.561Z","updated_at":"2025-11-07T01:04:12.455Z","avatar_url":"https://github.com/bboydflo.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"\u003ch1 align=\"left\"\u003eWelcome to use-value-after 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/use-value-after\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/use-value-after.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/bboydflo/use-value-after\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/CosminOnciu\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Twitter: CosminOnciu\" src=\"https://img.shields.io/twitter/follow/CosminOnciu.svg?style=social\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e react hook to use values from an array after delay. when reaching the end of the array it will start from the beginning\n\n### 🏠 [Homepage](https://github.com/bboydflo/use-value-after)\n\n## Install\n\n```sh\nnpm install\n```\n\n## Usage\n\nThis hook comes in handy when testing edge cases for a React component by generating a new set of props after a specific delay\n\n```js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { useValueAfter } from 'use-value-after'\n\nconst TestComponent = (props) =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003ch2\u003e{props.title}\u003c/h2\u003e\n      \u003cp\u003e{props.text}\u003c/p\u003e\n    \u003c/div\u003e\n  )\n}\n\nconst updatePropsAfterMs = 1000\nconst testComponentProps = [\n  {title: '', text: ''},\n  {title: '', text: 'No title'},\n  {title: 'Short title', text: ''},\n  {title: 'Short title', text: 'Really small paragraph'}\n]\n\nconst App = () =\u003e {\n  const props = useValueAfter(testComponentProps, updatePropsAfterMs)\n  return (\n    \u003cdiv className='App'\u003e\n      \u003cTestComponent {...props} /\u003e\n    \u003c/div\u003e\n  )\n}\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'))\n```\n\n## CodeSandbox Demo\n\nFor a demo [take a look here](https://codesandbox.io/s/use-value-after-demo-ov7lz)\n\n## Author\n\n👤 **Florin Cosmin Onciu**\n\n* Twitter: [@CosminOnciu](https://twitter.com/CosminOnciu)\n* Github: [@bboydflo](https://github.com/bboydflo)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/bboydflo/use-value-after/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboydflo%2Fuse-value-after","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbboydflo%2Fuse-value-after","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboydflo%2Fuse-value-after/lists"}