Function ModifiesFor

  • Once routes decorated with this decorator have been called, the provided outbound routes will be re-sent to all regular subscriptions and filtered subscriptions matching the filter.

    Parameters

    • filter: MessageFilter

      The filter to be used for matching the clients (e.g., for updating data for only one mandatory, ...).

    • Rest ...routes: string[]

      The outbound methods that are modified and should be re-sent.

    Returns ((target, propertyKey) => void)

      • (target, propertyKey): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

    Example

    Method annotation:

    @Route("example")
    class Example {

    @Outbound("d.data")
    @SubscribeFor(new MyMessageFilter())
    async getData(connection: WebsocketConnection): Promise<any> {
    return [...];
    }

    @Route("save")
    @ModifiesFor(new MyMessageFilter(), "d.data")
    async save(data: any, connection: WebsocketConnection): Promise<any> {
    [...]
    // outbound `d.data` is re-sent to all subscribed clients once this method has been executed successfully
    }
    }

Generated using TypeDoc