Licence
MIT
Version
2.3.2
Deps
1
Size
417 kB
Vulns
0
Weekly
0
react-hook-use-cta: useCTA (use Call To Action)
Read full document for react-hook-use-cta on documentation website
Install
npm i react-hook-use-cta
yarn add react-hook-use-cta
deno add jsr:@rafde/react-hook-use-cta
useCTA
import { useCTA, } from 'react-hook-use-cta';
const [
history,
dispatch
] = useCTA({
initial: {
value: 0,
},
});
createCTA
import { createCTA, } from 'react-hook-use-cta';
const [
history,
dispatch
] = createCTA({
initial: {
value: 0,
},
});
createCTAContext
import { createCTAContext, } from 'react-hook-use-cta';
const context = createCTAContext({
initial: {
value: 0,
},
});
export const CTAProvider = context.CTAProvider;
export const useCTAHistoryContext = context.useCTAHistoryContext;
export const useCTADispatchContext = context.useCTADispatchContext;
createCTASelector
import { createCTASelector, } from 'react-hook-use-cta';
export const useCTASelector = createCTASelector({
initial: {
value: 0,
},
});