-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mandatory-UseEvent does not warn on effect stores
- Loading branch information
1 parent
33f8718
commit 5f94ae2
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
rules/mandatory-useEvent/examples/correct-effect-store-via-useStore.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
import { useEvent, useStore } from "effector-react"; | ||
|
||
import { fetchFx } from "./model"; | ||
|
||
const Button: React.FC = () => { | ||
const loading = useStore(fetchFx.pending); | ||
|
||
if (loading) { | ||
return null; | ||
} | ||
|
||
return <button>click</button>; | ||
}; | ||
|
||
export { Button }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters