New hook for the pets

This commit is contained in:
object 2022-08-10 16:32:13 +00:00
parent 7b90987b29
commit d2b2c363aa
2 changed files with 17 additions and 0 deletions

1
src/hooks/pets/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './usePets';

16
src/hooks/pets/usePets.ts Normal file
View File

@ -0,0 +1,16 @@
import { useState } from 'react';
import { useBetween } from 'use-between';
const usePetsState = () =>
{
const [ petRespect, setPetRespect ] = useState(0);
const changePetRespect = (respects: React.SetStateAction<number>) =>
{
setPetRespect(respects);
}
return { petRespect, setPetRespect, changePetRespect };
}
export const usePets = () => useBetween(usePetsState);