Skip to content

Commit edf4a57

Browse files
miguelollermarkerikson
authored andcommitted
Remove batch arg from createListenerCollection (#1205)
This prevents a bug with Terser (webpack's default minifier) where the returned batch function isn't defined due to function inlining.
1 parent 71dec8a commit edf4a57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/Subscription.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { getBatch } from './batch'
77
const CLEARED = null
88
const nullListeners = { notify() {} }
99

10-
function createListenerCollection(batch) {
10+
function createListenerCollection() {
11+
const batch = getBatch()
1112
// the current/next pattern is copied from redux's createStore code.
1213
// TODO: refactor+expose that code to be reusable here?
1314
let current = []
@@ -83,7 +84,7 @@ export default class Subscription {
8384
? this.parentSub.addNestedSub(this.handleChangeWrapper)
8485
: this.store.subscribe(this.handleChangeWrapper)
8586

86-
this.listeners = createListenerCollection(getBatch())
87+
this.listeners = createListenerCollection()
8788
}
8889
}
8990

0 commit comments

Comments
 (0)