Skip to content
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

[snippet] Snippet snippet-redraw-url and snippet-redraw-event data attributes. #47

Open
Machy8 opened this issue Aug 21, 2024 · 0 comments

Comments

@Machy8
Copy link
Contributor

Machy8 commented Aug 21, 2024

Describe the problem

  • This would allow a snippet to redraw itself by either dispatching an event or calling the redrawSnippet method.
  • If snippet has an URL, it will send a get request to that URL, get HTML response and redraw itself.
  • This would eliminate a lot of boilerplate and would simplify a lot of things like:
    • Add item into the cart
    • Refresh cart, delivery calculation, discounts and everything like that on website by triggering one event cart:updated through event dispatcher
    • Also, if any event inside snippet-redraw-event is triggered and it receives url address, it can trigger the redraw and override the default address. It could actually pass the entire config for javascript request.

Describe the proposed solution

.

Alternatives considered

.

Importance

would make my life easier

@Machy8 Machy8 changed the title [snippet] Snippet snippet-redraw-url and redraw-event data attributes. [snippet] Snippet snippet-redraw-url and snippet-redraw-event data attributes. Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant