Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.68 KB

TYPESCRIPT.md

File metadata and controls

36 lines (28 loc) · 1.68 KB

<- to the main page

Using Typescript

You can specify types of your hook if you use Typescript

// hooks.ts

import { MasterHook } from 'master-hook'

// Here you import your hook data
import * as myHook from './my-hook'

// Fot typesctipt, pass the types of your initialState, actions and selectors into MasterHook
export const useMyHook = MasterHook(myHook) as MasterHook<typeof myHook.initialState, typeof myHook.actions, typeof myHook.selectors>

See more: