Open joncursi opened 7 years ago
The same goes for fetching data. In many components, I need to fetch data if there is a user signed in. However, if there is no user, I shouldn't fetch the data. However, again, recompose HOCs do not support async for good reasons.
I'm not sure if this is the recommended way to do this, but my workaround for now is to store the tokens myself to my own Redux store:
onTokenChange((tokenData) => {
dispatch({
payload: tokenData,
type: UPDATE_USER,
});
});
In my render function, I want to render a View depending on whether or not the user is signed in or not. You can do this synchronously via:
How do you achieve this with
meteor-apollo-accounts
? The only thing I can find isuserId
, but that is an async value so it doesn't work in the above example. Thanks!