{"id":15765008,"url":"https://github.com/technote-space/use-unmount-ref","last_synced_at":"2025-06-13T20:39:55.905Z","repository":{"id":42066147,"uuid":"343695468","full_name":"technote-space/use-unmount-ref","owner":"technote-space","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-19T10:14:21.000Z","size":1605,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T14:46:56.928Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technote-space.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/technote0space"}},"created_at":"2021-03-02T08:15:04.000Z","updated_at":"2022-01-04T15:20:35.000Z","dependencies_parsed_at":"2024-09-02T13:30:45.617Z","dependency_job_id":"43277840-245d-4176-b6c7-c292ba7e0a88","html_url":"https://github.com/technote-space/use-unmount-ref","commit_stats":{"total_commits":142,"total_committers":2,"mean_commits":71.0,"dds":0.2676056338028169,"last_synced_commit":"cb946d08f3d5b54b8439530da3f91a81cc22cb75"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":"technote-space/ts-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fuse-unmount-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fuse-unmount-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fuse-unmount-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fuse-unmount-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technote-space","download_url":"https://codeload.github.com/technote-space/use-unmount-ref/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fuse-unmount-ref/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258892378,"owners_count":22773830,"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-04T12:24:13.003Z","updated_at":"2025-06-13T20:39:55.883Z","avatar_url":"https://github.com/technote-space.png","language":"TypeScript","funding_links":["https://paypal.me/technote0space"],"categories":[],"sub_categories":[],"readme":"# useUnmountRef\n\n[![npm version](https://badge.fury.io/js/%40technote-space%2Fuse-unmount-ref.svg)](https://badge.fury.io/js/%40technote-space%2Fuse-unmount-ref)\n[![CI Status](https://github.com/technote-space/use-unmount-ref/workflows/CI/badge.svg)](https://github.com/technote-space/use-unmount-ref/actions)\n[![codecov](https://codecov.io/gh/technote-space/use-unmount-ref/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/use-unmount-ref)\n[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/use-unmount-ref/badge)](https://www.codefactor.io/repository/github/technote-space/use-unmount-ref)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/use-unmount-ref/blob/master/LICENSE)\n\nReact hook to handle unmount ref.\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eDetails\u003c/summary\u003e\n\n- [Usage](#usage)\n  - [Install](#install)\n  - [Use](#use)\n- [Author](#author)\n\n\u003c/details\u003e\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Usage\n### Install\n`yarn add @technote-space/use-unmount-ref`\n\nor\n\n`npm i @technote-space/use-unmount-ref`\n\n### Use\n\ne.g.\n```tsx\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport useUnmountRef from '@technote-space/use-unmount-ref';\n\nconst TestPage: FC = () =\u003e {\n  const unmountRef = useUnmountRef();\n  const [isLoading, setIsLoading] = useState(false);\n  \n  useEffect(() =\u003e {\n    setIsLoading(true);\n    setTimeout(() =\u003e {\n      if(!unmountRef.current) {\n        setIsLoading(false);\n      }\n    }, 1000);\n  }, []);\n  \n  return \u003cdiv\u003e\n    {isLoading ? 'Loading...' : 'Not loading.'}\n  \u003c/div\u003e\n};\n```\n\n## Author\n[GitHub (Technote)](https://github.com/technote-space)  \n[Blog](https://technote.space)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fuse-unmount-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnote-space%2Fuse-unmount-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fuse-unmount-ref/lists"}