Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capable-health/hooks

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capable-health/hooks

In your app.tsx entry file, you will need to add the `CapableClientProvider`

  • 0.2.2
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Weekly downloads
 
Created
Source

Setup

In your app.tsx entry file, you will need to add the CapableClientProvider

import { CapableClient } from "@capable-health/client";
import { CapableClientProvider } from "@capable-health/hooks";

const capableClient = new CapableClient({
  TOKEN: () => Promise.resolve(""),
});

return (
  <CapableClientProvider capableClient={capableClient}>
    ...
  </CapableClientProvider>
);

NOTE: you need to remove <QueryClientProvider client={queryClient}> if you're using it. CapableClientProvider handles adding the QueryClientProvider for you.

Usage

In your component, you'll need to import the CapableClientHookContext which will provide you with the CapableClientHook object. From there, you can call any CapableClient endpoint and have all your responses cached using react-query.

import { useContext } from "react";
import { CapableClientHooksContext } from "@capable-health/hooks";

const capableClientHooks = useContext(CapableClientHooksContext);

const { data, isLoading, isError } = capableClientHooks.surveys.getSurveys({ id: "survey_id" })

FAQs

Package last updated on 13 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc