Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass EVENTS.DOM to onEvent #185

Merged
merged 2 commits into from
Aug 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: fix typo in MessageContext
  • Loading branch information
ambar committed Aug 10, 2021
commit e164c954c8368b7713c69d8653453455f11b7f63
12 changes: 6 additions & 6 deletions packages/griffith/src/contexts/Message/MessageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ export class MessageProvider extends React.PureComponent {
}

subscribeEvent = (eventName, listener) => {
const realLisener = ({__type__, data} = {}) => {
const realListener = ({__type__, data} = {}) => {
if (__type__ === EVENT_TYPE) {
listener(data)
}
}
this.emitter.on(eventName, realLisener)
this.emitter.on(eventName, realListener)

return {
unsubscribe: () => this.emitter.off(eventName, realLisener),
unsubscribe: () => this.emitter.off(eventName, realListener),
}
}

Expand All @@ -81,15 +81,15 @@ export class MessageProvider extends React.PureComponent {
}

subscribeAction = (eventName, listener) => {
const realLisener = ({__type__, data}) => {
const realListener = ({__type__, data}) => {
if (__type__ === ACTION_TYPE) {
listener(data)
}
}
this.emitter.on(eventName, realLisener)
this.emitter.on(eventName, realListener)

return {
unsubscribe: () => this.emitter.off(eventName, realLisener),
unsubscribe: () => this.emitter.off(eventName, realListener),
}
}

Expand Down