analytics-react-native icon indicating copy to clipboard operation
analytics-react-native copied to clipboard

reset() parameter documentation

Open adamcclifton opened this issue 2 years ago • 1 comments

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: https://github.com/segmentio/analytics-react-native/blob/e3ff0664fbeb8772d9fb2c855e4128027e91da0e/packages/core/src/analytics.ts#L679

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 avatar Nov 02 '23 00:11 adamcclifton

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 avatar Nov 14 '23 06:11 oscb

Addressed in PR https://github.com/segmentio/analytics-react-native/pull/951

hvardhan-unth avatar Jun 12 '24 06:06 hvardhan-unth