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

reset() parameter documentation #893

Open
adamcclifton opened this issue Nov 2, 2023 · 1 comment
Open

reset() parameter documentation #893

adamcclifton opened this issue Nov 2, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@adamcclifton
Copy link

adamcclifton commented Nov 2, 2023

The reset method is listed as having no parameters in the docs:
https://github.com/segmentio/analytics-react-native#reset
reset: () => void;

But it looks like it does actually take a parameter:

async reset(resetAnonymousId = true) {

And this is also reflected in the typescript definition analytics.d.ts.
reset(resetAnonymousId?: boolean): Promise<void>;

I think it would be good to unify these to increase clarity.

@adamcclifton adamcclifton added the bug Something isn't working label Nov 2, 2023
@oscb
Copy link
Contributor

oscb commented Nov 14, 2023

Hey Alan, this is a big miss on our end. Thanks for reporting.
I'll add the clarification of what this optional parameter does when turned off. Just to be clear the parameter is optional and if called without it it will work just as the README mentions. When false is passed as an argument it will skip resetting the anonymousId (but reset the rest of the user data.

@oscb oscb self-assigned this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants