analytics-react-native
analytics-react-native copied to clipboard
reset() parameter documentation
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.
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.
Addressed in PR https://github.com/segmentio/analytics-react-native/pull/951