Skip to content

Commit 2f57bcc

Browse files
committed
small fix
1 parent 599962e commit 2f57bcc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/utils/Subscription.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ import { getBatch } from './batch'
77
const nullListeners = { notify() {} }
88

99
function createListenerCollection() {
10-
var batch = getBatch() // the current/next pattern is copied from redux's createStore code.
10+
var batch = getBatch()
11+
// the current/next pattern is copied from redux's createStore code.
1112
// TODO: refactor+expose that code to be reusable here?
1213

1314
var current = {}
1415
var id = 0
1516
return {
16-
clear: function clear() {
17+
clear() {
1718
current = {}
1819
},
19-
notify: function notify() {
20+
notify() {
2021
var listeners = current
21-
batch(function() {
22+
batch(() => {
2223
for (const id in listeners) {
2324
listeners[id]()
2425
}
@@ -29,7 +30,7 @@ function createListenerCollection() {
2930
return current
3031
},
3132

32-
subscribe: function subscribe(listener) {
33+
subscribe(listener) {
3334
var currentId = id++
3435
current[currentId] = listener
3536
return function unsubscribe() {

0 commit comments

Comments
 (0)