react-pubsub icon indicating copy to clipboard operation
react-pubsub copied to clipboard

Active development?

Open Sigfried opened this issue 9 years ago • 3 comments

Hi. This looks like exactly what I need, but it doesn't seem to be widely used or to be under active development. Do you recommend using it or is there another library that might be a better bet? Thanks!

Sigfried avatar Nov 28 '16 16:11 Sigfried

Seems to be some good advice here: http://andrewhfarmer.com/component-communication/#6-observer-pattern -- for anyone with the same question I have.

Sigfried avatar Nov 28 '16 16:11 Sigfried

Hi @Sigfried . I'm actually using it on https://timerepublik.com but we (+ @cef62 ) are not actively developing it (also 'coz I don't need any more customisations). You can try it (it's been intensively tested by Matteo), and if you want you can contribute to it. Otherwise, there's something ~ similar here https://github.com/ReactTraining/react-broadcast

stecb avatar Nov 28 '16 16:11 stecb

Thanks, @stecb !

It turned out super easy for what I wanted to do by using EventEmitter. A two-line module (https://github.com/Sigfried/drugutil/blob/master/src/EventEmitter.js) that I import from whatever modules I want to publish or subscribe from. The emitter object is accessible anywhere like a global variable, but I didn't need to make an actual global variable or pass things all over or use react context (which seems scary).

Thanks so much, though!

Sigfried avatar Nov 30 '16 15:11 Sigfried