Home Reference Source
import Middleware from '@osjs/client/src/middleware.js'
public class | source

Middleware

Middleware Manager

Constructor Summary

Public Constructor
public

Create new middleware

Member Summary

Public Members
public

Method Summary

Public Methods
public

add(group: string, callback: Function)

Add middleware function to a group

public

clear()

Clear middleware

public

Destroy middleware

public

get(group: string): Function[]

Gets middleware functions for a group

public

remove(group: string, callback: Function)

Remove middleware function from a group

Public Constructors

public constructor() source

Create new middleware

Public Members

public middleware: MiddlewareData source

Public Methods

public add(group: string, callback: Function) source

Add middleware function to a group

Params:

NameTypeAttributeDescription
group string

Middleware group

callback Function

Middleware function to add

public clear() source

Clear middleware

public destroy() source

Destroy middleware

public get(group: string): Function[] source

Gets middleware functions for a group

Params:

NameTypeAttributeDescription
group string

Middleware group

Return:

Function[]

public remove(group: string, callback: Function) source

Remove middleware function from a group

Params:

NameTypeAttributeDescription
group string

Middleware group

callback Function

Middleware function to remove