Function createMediator

  • Creates a Mediator instance with a specific initial context.

    Type Parameters

    • Context extends JSONObject

    • EventName extends string = string

    Parameters

    • initialContext: Context

      The initial context for the Mediator.

    Returns Mediator<Context, EventName>

    A Mediator instance with the specified context type and event names.

    Function

    createMediator

    Default Value

    string
    

    Example

    type MyEvents =  'item:added' | 'item:removed'

    interface MyContext extends MediatorContext {
    items: number[]
    }

    const myMediator = createMediator<MyContext, MyEvents>(initialContext)

Generated using TypeDoc