【文件属性】:
文件名称:use-dispatcher:useDispatcher钩子用于react-redux
文件大小:12KB
文件格式:ZIP
更新时间:2021-04-01 06:41:26
TypeScript
使用调度程序
一个易于使用的“打字稿友好”钩子,用于在react / redux中进行调度。
注意:此程序包可以使用或不使用打字稿!
安装
使用安装:
npm i use-dispatcher
或:
yarn add use-dispatcher
基本用法:
您都可以将动作创建者函数或固定动作传递给useDispatcher函数,它将返回一个可以调用以分派该动作的函数。
import { useDispatcher } from "use-dispatcher"
const MyComponent : FunctionComponent = ( props ) => {
const dispatchIncrement = useDispatcher ( { type : "INCREMENT_COUNTER" } ) ;
return ( < div>
【文件预览】:
use-dispatcher-main
----yarn.lock(16KB)
----src()
--------index.ts(1KB)
----tsconfig.json(274B)
----LICENSE(1KB)
----.prettierrc(78B)
----tslint.json(69B)
----README.md(3KB)
----.gitignore(2KB)
----package.json(1KB)