Open abrhim opened 3 years ago
Hi @abrhim. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
@magento export issue to JIRA project PWA as Story
:white_check_mark: Jira issue (https://jira.corp.magento.com/browse/PWA-1444) is successfully created for this issue.
This is blocked internally by a spike to research possibilities for a secure, built-in eventing system, PWA-1389.
Is your feature request related to a problem? Please describe. Data Solutions uses cart events to track user behavior. Right now we are looking thru Peregrine to find talons and wrapping handleAddToCart and handleRemoveFromCart functions, but this is proving to be difficult because these functions are callbacks called within a react hook later. This removes the ability to call any of our custom hooks within these functions.
Describe the solution you'd like An internal pub/sub that publishes cart events.
Describe alternatives you've considered wrapping the useMiniCart and hitting the graphql cache on every render, maintaining the previous value and comparing it to the current to determine if items were added/removed from cart.
Additional context none
Please let us know what packages this feature is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
create-pwa