-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat(store-sdk): custom events, tests and docs #937
Conversation
…from unwrap function
✔️ Deploy Preview for storeui ready! 🔨 Explore the source changes: 500dfec 🔍 Inspect the deploy log: https://app.netlify.com/sites/storeui/deploys/613a41d19850d00007545cfc 😎 Browse the preview: https://deploy-preview-937--storeui.netlify.app |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 500dfec:
|
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.
Nice! some small nits
Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
* fix: general wrapper types for analytics and removed unecessary code from unwrap function * chore: renaming analytics index file to wrap * chore: adding wrap and unwrap functions tests * chore: adding tests to analytics layer * feat: allows sending custom analytics events * feat: add docs to analytics * chore: add test for custom event * docs: adding link to GA4 spec * chore: removing tsdx incompatible code * fix: change title name to analytics * docs: correct grammar Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com> * docs: improve readability and fix erros on code Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br> * chore: improve error message from useAnalyticsEvent Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br> * chore: moving event samples to fixture file Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com> Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
* fix: general wrapper types for analytics and removed unecessary code from unwrap function * chore: renaming analytics index file to wrap * chore: adding wrap and unwrap functions tests * chore: adding tests to analytics layer * feat: allows sending custom analytics events * feat: add docs to analytics * chore: add test for custom event * docs: adding link to GA4 spec * chore: removing tsdx incompatible code * fix: change title name to analytics * docs: correct grammar Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com> * docs: improve readability and fix erros on code Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br> * chore: improve error message from useAnalyticsEvent Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br> * chore: moving event samples to fixture file Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com> Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
What's the purpose of this pull request?
This PR adds tests and docs to analytics and changes the types so users are able to send and receive custom events as well.
How it works?
This PR adds a type called
UnknownEvent
. It's the minimal event that can be sent viasendAnalyticsEvent
. The suggestions for the AnalyticsEvent still happen, but users can override it with their own events by overriding the generic type on thesendAnalyticsEvent
function.