Utility hooks for React and React Native apps.
yarn add @blockmatic/hooks-utils
import { createContextHook } from '@blockmatic/hooks-utils'
import React from 'react'
const useHookFn = () => {
const [state, setState] = React.useState(false)
const toggle = () => setState(!state)
return { state, toggle }
}
export const [useHook, HookProvider] = createContextHook(
useHookFn,
'You must wrap your application with <HookProvider /> in order to useHook().',
)
Read the contributing guidelines for details.
Blockmatic is building robust ecosystem of people and tools for development of blockchain applications.