Created
November 26, 2018 17:13
-
-
Save stubailo/0d1ff3491c123d1d4be436c270d93aeb to your computer and use it in GitHub Desktop.
A provider that lets you mock loading state
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
const LoadingProvider = (props) => { | |
const link = new ApolloLink((operation) => { | |
return new Observable(() => {}); | |
}); | |
const client = new ApolloClient({ | |
link, | |
cache: new InMemoryCache(), | |
}); | |
return ( | |
<ApolloProvider client={client}> | |
{props.children} | |
</ApolloProvider> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where does Observable come from? Do you have to bring in RxJS just to get this to work?