Skip to content

Commit 946bfa3

Browse files
omertstimdorr
authored andcommitted
Changed unsubscribe from let to const (reduxjs#2582)
Using const is more correct since you don't want unsubscribe to be mutated
1 parent 02f9e7b commit 946bfa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/basics/Store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ console.log(store.getState())
4343

4444
// Every time the state changes, log it
4545
// Note that subscribe() returns a function for unregistering the listener
46-
let unsubscribe = store.subscribe(() =>
46+
const unsubscribe = store.subscribe(() =>
4747
console.log(store.getState())
4848
)
4949

0 commit comments

Comments
 (0)