-
Notifications
You must be signed in to change notification settings - Fork 197
fix: #identify argument type #384
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for noticing this and taking action!
I left some minor suggestions but otherwise this looks good!
Thanks @oscb for your fast and positive feedback! I've applied your suggestions 😊 |
Hi @raminos Happy New Year! looks like there is still one comment left in our review. Happy to merge once that's been accounted for. |
Hi @alanjcharles 🤗 Happy New Year to you too! I totally missed that I didn't update the second comment! Thanks for reminding me 😍 commit is coming in a sec! |
@alanjcharles the code changed a bit in the meantime. The ternary operator is not super pretty but it gets the work done. Is there something I should change? |
@raminos sorry for the delay!! we've had to take some unexpected time out of office in the past few weeks. Thanks so much for the update. I can take a closer look in a bit and let you know. Thanks again |
@raminos we're ready to merge this as soon as the test you added passes! It looks pretty straightforward but let me know if I can help at all. Thanks! |
accounted for in #436 thanks again! |
Hello library maintainers 👋 ,
thanks for this lovely library! @alan-eu we are happily using your service but we came across an incoherence between your docs and your code which I attempt to fix in this PR.
I read your contributing guidelines but couldn't find a pull request template. I hope the format I chose is okay.
Problem
In your docs you state for the
userId
argument of theidentify
method:But with the current implementation Typescript won't allow us to omit a
userId
. We circumvent this issue by passingundefined as any
but this is suboptimal.Solution
I tried to adjust the
identify
method's behaviour in a way that is in line with the existing logic, namely:userId
can beundefined
userId
isundefined
the store is not updatedTests
I added a test case checking that only the user traits are updated when passing
undefined
as auserId
. I tried to follow the preexisting unit test style.As stated in the guidelines I ran all the scripts mentioned to check that tests, linting and the typescript compiler pass.
I'm looking forward to your comments!
Best,
Ramin