Created
September 23, 2021 19:40
-
-
Save vgrafe/13f20faae6821750521f498f09e05253 to your computer and use it in GitHub Desktop.
adam-next
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
import useSession from next-auth | |
import useState from react | |
const usePlaidSession = () => { | |
const [linked, setLinked] = useState(false); | |
const [session, loading] = useSession(); | |
const isLinked = linked || session.linked; | |
return {session, isLinked, loading, setLinked} | |
} | |
// in your app, you call usePlaidSession to get the state | |
// in the plaid button, you call usePlaidSession's setLinked(true) after sucesful link action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment