Skip to content

Commit 041574c

Browse files
jsgao0frappacchio
authored andcommitted
Update README.md
Must pass parameters to the conditional function or it might cause variable pollution. 692 add fsm, listNode arguments 696 add fsmInstance, listNodeInstance parameters
1 parent 06f8296 commit 041574c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,11 @@ if (fsm.state === 'fetching' && isEmpty(listNode)) {
689689

690690
**Good**:
691691
```javascript
692-
function shouldShowSpinner() {
692+
function shouldShowSpinner(fsm, listNode) {
693693
return fsm.state === 'fetching' && isEmpty(listNode);
694694
}
695695

696-
if (shouldShowSpinner()) {
696+
if (shouldShowSpinner(fsmInstance, listNodeInstance)) {
697697
// ...
698698
}
699699
```

0 commit comments

Comments
 (0)