segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 181 forks source link

reset() parameter documentation #893

Closed adamcclifton closed 3 weeks ago

adamcclifton commented 8 months ago

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.

oscb commented 7 months ago

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.

hvardhan-unth commented 3 weeks ago

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