@webshop/root - v1.0.0
    Preparing search index...

    Service to allow components to communicate with eachother through events

    Index

    Constructors

    Methods

    • Listen for a web event and execute a function when it occurs

      Type Parameters

      • T

        Type used for the event data

      Parameters

      • webEvent: Welcome

        Kind of web event to listen for

      • callback: (data: T) => void

        Function to call when the web event occurs. Will get the event data as an argument.

      Returns void

    • Dispatch a web event

      Type Parameters

      • T

        Type used for the event data

      Parameters

      • webEvent: Welcome

        Kind of web event to dispatch

      • Optionaldata: T

        Event data to send along with the dispatch

      Returns void