Supervised-Emitter

Supervised-Emitter

Index

Classes

Interfaces

Type aliases

Functions

Type aliases

IGetScope

Ƭ IGetScope: function

Closure function that can add scope to the provide event

param Event

Type declaration:

▸ (event: string): string

Parameters:

Name Type
event string

IHandler

Ƭ IHandler: function

Type declaration:

▸ (ctx: IContext, ...args: any[]): any | Promise‹any›

Parameters:

Name Type
ctx IContext
...args any[]

IMiddleware

Ƭ IMiddleware: function

Function signature of middlewares

Type declaration:

▸ (ctx: IContext): Promise‹any› | any

Parameters:

Name Type
ctx IContext

Functions

getMapKeys

getMapKeys(map: Map‹string, boolean›): string[]

Returns all the keys in the Map

Parameters:

Name Type Description
map Map‹string, boolean› Map

Returns: string[]

List of keys in the given map


Const internalEvent

internalEvent(ev: string): string

Suffixes internal event part to the given event

Parameters:

Name Type Description
ev string Event

Returns: string


mergeOptions

mergeOptions(givenOpts: any, defaultOpts: any): any

Parameters:

Name Type Default
givenOpts any {}
defaultOpts any {}

Returns: any


patternHandler

patternHandler(pattern: string, middleware: IMiddleware): IMiddleware

Creates a middleware which will be run only when the pubEvent matches the given pattern

Parameters:

Name Type Description
pattern string Subscription event
middleware IMiddleware Middleware subscribed on the pattern

Returns: IMiddleware

results matching ""

    No results matching ""