/use-event-subscribe

React hook to subscribe to an event

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

useEventSubscribe react hook

npm

A React Hook to subscribe to an event.


Installation


Installation

$ yarn add use-event-subscribe

Import

import useEventSubscribe from 'use-event-subscribe';

Usage

useEventSubscribe('eventName', ({detail}) => {
  /* code here */
})