Events
Learn how to handle permission updates in your application
Overview
Permix provides an event system that allows you to react to permission changes in your application. Each event provides type-safe data and hooks to register handlers.
Usage
You can register event handlers using the hook
and hookOnce
methods:
Available events:
setup
- Triggered when permissions are updated through thesetup
method.ready
- Triggered when the permissions are ready to be used.hydrate
- Triggered when the permissions are hydrated from the server.