feathers-plus / feathers-offline-realtime

Offline-first realtime replication, with optimistic updates while connected.
MIT License
33 stars 9 forks source link

Use npm 'component-emitter' instead of 'events' #7

Closed eddyystop closed 7 years ago

eddyystop commented 7 years ago

Because socket.io uses 'component-emitter'. 'events' has not been updated lately.

daffl commented 7 years ago

What is the difference? Should we consider this for other things as well?

eddyystop commented 7 years ago

Gozala/events has 245 stars, hasn't been updated to the latest Node specs and the author doesn't work on it much.

component/emitter has 358 stars and is used by socket.io. There is no comment on Node compatibility.

I don't know what the differences are but I like the idea of using only one repo rather than several. I also think socket.io would have put more effort into choosing a repo.

I do think its better if Feathers uses one emitter repo and, since Feathers is dependant on socket.io in practice, we could use the one they do.

daffl commented 7 years ago

I agree. I looked briefly into it and it looks like it provider the .off method that the Node event emitter doesn't. I will try today to use it instead of the events package for v3 core and see if it breaks anything (I don't think it would though).

eddyystop commented 7 years ago

I've switched to it in feathers-offline-*.

The only issue was I could not use it in class foo extends emitter. There a few es6 emitters but they have less than 20 stars.