-
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Milestone
Description
In the docs, we have this example:
import { createBarrier } from '@farfetched/core';
const $authToken = createStore(/* ... */);
const authBarrier = createBarrier({
active: combine($authToken, (token) => isTokenInvalid(token)),
});However, there is no way to check if the token is valid synchronously in Firebase, as getIdToken() always returns a promise.
https://firebase.google.com/docs/reference/js/v8/firebase.User#getidtoken
Maybe active should also accept an effect that returns a boolean?