-
Hi, I wonder how can I use By reading relay doc, it requires taking
|
Beta Was this translation helpful? Give feedback.
Answered by
rrdelaney
Aug 6, 2022
Replies: 1 comment
-
Hi @p-null! Relay exports a hook to get the environment used in function Ticker() {
const env = useRelayEnvironment();
useEffect(() => {
const tickInterval = setInterval(() => {
commitLocalUpdate(env, (store) => {
// ...
});
}, 3000);
return () => clearInterval(tickInterval);
}, [env]);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rrdelaney
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @p-null! Relay exports a hook to get the environment used in
RelayEnvironmentProvider
:useRelayEnvironment
. Passing this tocommitLocalUpdate
should work: