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

Use mitt instead of EventEmitter for the client HMR error handling #1399

Merged
merged 2 commits into from
Mar 13, 2017
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions client/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createElement } from 'react'
import ReactDOM from 'react-dom'
import { EventEmitter } from 'events'
import mitt from 'mitt'
import HeadManager from './head-manager'
import { createRouter } from '../lib/router'
import App from '../lib/app'
Expand Down Expand Up @@ -42,7 +42,7 @@ const headManager = new HeadManager()
const container = document.getElementById('__next')

export default (onError) => {
const emitter = new EventEmitter()
const emitter = mitt()

router.subscribe(({ Component, props, hash, err }) => {
render({ Component, props, err, hash, emitter }, onError)
Expand Down