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

Put extra arguments for the getData callback #108

Closed
vladyslavKucheruk opened this issue Jun 6, 2023 · 4 comments · Fixed by #109
Closed

Put extra arguments for the getData callback #108

vladyslavKucheruk opened this issue Jun 6, 2023 · 4 comments · Fixed by #109
Assignees
Labels

Comments

@vladyslavKucheruk
Copy link

I have an intention to use getData function like this:

const customParams = undefined;
const { getData } = useVisitorData(customParams, { immediate: false });
...

const onSubmit = async () => {
  const response = await axios.get(...);
  await getData({ ignoreCache: true }, { linkedId: response.id, tag: { action: 'EXAMPLE_ACTION' } })
}

I cannot do that as getData doesn't take extra arguments.
Which means I have to define custom arguments statically, when I initialize useVisitorData hook.

Could you please correct me if I am wrong with the usage or provide the solution for this specific case.
Thank you!

@ilfa
Copy link
Member

ilfa commented Jun 6, 2023

Hi @vladyslavKucheruk,
Thank you for the issue. I agree with you, it makes sense!
I'll provide a solution for your case soon.

@ilfa ilfa self-assigned this Jun 6, 2023
@ilfa ilfa closed this as completed in #109 Jun 9, 2023
ilfa pushed a commit that referenced this issue Jun 9, 2023
## [2.4.0](v2.3.3...v2.4.0) (2023-06-09)

### Features

* extend `getData` options with `fingerprintjs-pro` `GetDataOptions`. [#108](#108) ([fe2961e](fe2961e))

### Build System

* **deps:** update typedoc version to get improved documentation page design ([778bb4d](778bb4d))
@ilfa
Copy link
Member

ilfa commented Jun 9, 2023

🎉 This issue has been resolved in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ilfa ilfa added the released label Jun 9, 2023
@ilfa
Copy link
Member

ilfa commented Jun 9, 2023

@vladyslavKucheruk you can try v2.4.0.

Just pass options to the getData function like:

const onSubmit = async () => {
  const response = await axios.get(...);
  await getData({ ignoreCache: true, linkedId: response.id, tag: { action: 'EXAMPLE_ACTION' } })
}

@vladyslavKucheruk
Copy link
Author

Thank you so much, I appreciate your support. Now it looks more similar to js and RN packages!

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

Successfully merging a pull request may close this issue.

2 participants