Closed cblgh closed 4 years ago
✨✨✨✨✨✨
👍 (I like event emitters - good idea!)
sorry for the messy diff, i reorganized some stuff which i should have probably left for a different pr
Awesome!
@cblgh I noticed that the terminology for some of the fields seems to vary across the events:
nick
vs name
msg
vs message
author
is sometimes a key, sometimes an objectkey
vs userKey
It would be really nice to have consistent words for these across the event API.
It would be really nice to have consistent words for these across the event API.
@noffle agreed! i intend to fix the naming before merging :~ thanks for listing the occurrences you found when reading through the code
oooooookay added docs
@nikolaiwarner any thoughts on the final review? otherwise i'll merge tomorrow morning :)
@cblgh lgtm!
... and by that i mean this is pure 🔥🔥🔥🔥🔥
:clap:
this pr introduces the modular event listeners we have been craving :3
it needs better documentation and the cli has not been rewritten using only the new listeners. the old update event is still emitted, so integrating the new listeners can be done in a pieacemeal fashion.
i believe the
init
event will be useful for cli & desktop alike : )debug
is also introduced as a module, which allows for really nice logs of events using e.g. the following invocationsee below for the list of events that are emitted, and please review to find any bugs <3
events and payloads are documented as
<type>
:<payload>|empty
:init
: emptynick-change
:{ key, newNick, oldNick }
user-updated
:{ key, user }
new-channel
:{ channel }
new-message
:{ channel, author: { name, key, local, online }, message }
note: includes chat/topic, chat/emote, chat/textpublish-message
:{ msg, timestamp }
publish-nick
:{ nick }
status-message
:{ channel, message }
topic
:{ channel, topic }
channel-focus
:{ channel }
channel-join
:{ userKey, channel, isLocal }
channel-leave
:{ userKey, channel, isLocal }
cabal-focus
:{ cabalKey }
started-peering
:{ key, name }
stoppped-peering
:{ key, name }
update
: empty - generic update from previous iteration, signals that something changedsome renaming of emitted keys might be warranted to increase cohesion / aesthetics :~~
fixes #23