UNPKG

create-pubsub

Version:

A tiny Event Emitter and Observable Store.

2 lines (1 loc) 391 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["create-pubsub-react"]={},e.React)}(this,(function(e,t){"use strict";e.usePubSub=function([e,n,u]){const[f,o]=t.useState(u());return t.useEffect((()=>n(o)),[]),[f,e]}}));