You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

12 lines
325 B

  1. // ** Imports createContext function
  2. import { createContext } from 'react'
  3. // ** Imports createContextualCan function
  4. import { createContextualCan } from '@casl/react'
  5. // ** Create Context
  6. export const AbilityContext = createContext()
  7. // ** Init Can Context
  8. export const Can = createContextualCan(AbilityContext.Consumer)