用于检查 API 服务健康状况的轻量级 React 钩子。

时间:2024-06-28 08:33:49
【文件属性】:

文件名称:用于检查 API 服务健康状况的轻量级 React 钩子。

文件大小:216KB

文件格式:ZIP

更新时间:2024-06-28 08:33:49

Awesome React Hooks

React Health Check :hospital: 轻量级 React 钩子,用于检查 API 服务的健康状况。 安装:mechanic: npm i @webscopeio/react-health-check 或 yarn add @webscopeio/react-health-check 示例:astonished_face: 基本全局配置用法 :red_question_mark: const { available, refresh } = useHealthCheck({ service: { name: 'auth' , url: 'https://example.com/auth/health', }, onSuccess: ({ service, timestamp }) => { console.log(`Service "${service.name}" is available from "$ {timestamp}" :party_popper:`); }, onError: ({ service, timestamp }) => { console


【文件预览】:
react-health-check-next
----.gitignore(88B)
----tsconfig.json(510B)
----README.md(3KB)
----.github()
--------workflows()
----rollup.config.js(258B)
----tsconfig.eslint.json(76B)
----.prettierrc(136B)
----tests()
--------helpers.spec.ts(5KB)
----examples()
--------global-conf()
--------basic()
----LICENSE(1KB)
----package.json(2KB)
----.license-sh.json(589B)
----src()
--------types.ts(827B)
--------config.ts(450B)
--------helpers.ts(3KB)
--------index.ts(254B)
--------use-health-check.ts(3KB)
----jest.config.js(82B)
----.npmignore(226B)
----.eslintrc.js(780B)
----package-lock.json(265KB)

网友评论