Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 1.54 KB

README.md

File metadata and controls

84 lines (64 loc) · 1.54 KB

react-hook-use-cta: useCTA (use Call To Action)

NPM License NPM Version JSR Version Test Lines

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,
	},
});