Using With SPA
Many sites update content dynamically, and it’s possible to do this with Whisk SDK.
Updating Widget
For example, your user switches from one recipe page to another and you want to update the recipe URL for the widget. For that, you need to remove the old widget definition and create a new one.
Make sure you call display with updated widget id:
Updating Event Listeners
Same logic applies for event listeners. Whenever you want to update listener just remove it and create a new one.
Subscriptions
Whenever you remove widget or event listeners, all subscriptions will be removed as well. So whenever you update your widget or event listener don't forget to subscribe to desired events again.
Last updated