Pricing Blog

Help on Toast

  • sakamotochan-1404832293662625943

    Sakamoto

    16 days ago

    I need some help with setting up toast messages after an API call. I'm using Spark Core but I'm having trouble understanding the documentation for this specific feature.

    Has anyone done this before? Is there a good guide or tutorial you could point me to?

    Any help would be greatly appreciated!
  • jaycmpb-1404843492034740334

    Jay Campbell

    16 days ago

    To use the toast from Spark Core, you must subscribe to the "sc-toast-provider" context and the showToast workflow it exposes. Then after your API call you can then trigger this showToast with the appropriate message.

    Note that it might not show in the editor, I normally test them in a new tab.
  • sakamotochan-1404889077982957638

    Sakamoto

    15 days ago

    Does this mean the whole page needs to be wrapped in a component including the API call?
    Thanks.
  • jaycmpb-1404899790818639872

    Jay Campbell

    15 days ago

    Yes, to subscribe to context it has to be a component child of the provider.
    🙏1
  • Tod-1404899792756150324

    Tod

    15 days ago

    Great job @Jay Campbell! Your contribution to the Nordcraft Community just made you advance to Community Level 8! 🌲