Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.86 KB

README.md

File metadata and controls

63 lines (43 loc) · 1.86 KB

Hooks Utils

Utility hooks for React and React Native apps.

Usage

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().',
)

Contributing

Read the contributing guidelines for details.

Blockmatic

Blockmatic is building robust ecosystem of people and tools for development of blockchain applications.

blockmatic.io

Blockmatic Twitter Blockmatic Facebook Blockmatic Github