All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.BoundHotkeysProxyProvider.tsx Maven / Gradle / Ivy

The newest version!
import { createContext, ReactNode, useContext } from 'react'
import { Hotkey } from './types'

type BoundHotkeysProxyProviderType = {
  addHotkey: (hotkey: Hotkey) => void
  removeHotkey: (hotkey: Hotkey) => void
}

const BoundHotkeysProxyProvider = createContext(undefined)

export const useBoundHotkeysProxy = () => {
  return useContext(BoundHotkeysProxyProvider)
}

interface Props {
  children: ReactNode
  addHotkey: (hotkey: Hotkey) => void
  removeHotkey: (hotkey: Hotkey) => void
}

export default function BoundHotkeysProxyProviderProvider({ addHotkey, removeHotkey, children }: Props) {
  return (
    
      {children}
    
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy