Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive token value #4

Open
damonjanis opened this issue Jun 8, 2019 · 2 comments
Open

Reactive token value #4

damonjanis opened this issue Jun 8, 2019 · 2 comments

Comments

@damonjanis
Copy link

When I pass a dynamic token into the component it doesn't stick. If I'm understanding the code, it looks like the token is applied when the Plaid Link script is loaded, and then everything is static.

Would it be possible to make the token reactive?

@pushchris
Copy link
Contributor

@damonjanis it should be possible. Would have to do some research to see if Plaid allows you to switch that information from their class after its instantiated, otherwise it would involve destroying the Plaid object and recreating it whenever one of the parameters changes. Not the most elegant solution, but should handle what you are looking for. Schedule is unfortunately busy currently but will try to give it a gander in the next week or so.

@damonjanis
Copy link
Author

damonjanis commented Jun 11, 2019

Thanks @pushchris, I so appreciate what you've done with this component and making it available.

I figured out a hack that works without requiring a change to the component. And it might indicate the Plaid object can be reinstantiated.

PlaidLink is created with a ref like this:

<PlaidLink ref="plaidLinkRef" ...> </PlaidLink>

Then whenever the token needs to change it calls onScriptLoaded and handleOnClick to reload the Plaid Link object like this:

this.$refs.plaidLinkRef.onScriptLoaded() this.$refs.plaidLinkRef.handleOnClick()

The script reloads with the new token set and the Plaid Link object goes from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants