Skip to content

Utility hooks for React and React Native apps

License

Notifications You must be signed in to change notification settings

blockmatic/hooks-utils

Repository files navigation

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