Composer<T extends Object> class

A simple middleware compose builder

Constructors

Composer()

Properties

length → int
The number of middleware installed in Composer
read-only
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

after(Middleware<T> middleware, Middleware<T> afterMiddleware) Composer<T>
Runs the second middleware after the main
before(Middleware<T> beforeMiddleware, Middleware<T> middleware) Composer<T>
Runs the second middleware before the main
branch(dynamic condition, Middleware<T> trueMiddleware, Middleware<T> falseMiddleware) Composer<T>
By condition splits the middleware
caught(CaughtMiddlewareHandler<T> errorHandler) Composer<T>
Catches errors in the middleware chain
clone() Composer<T>
Clones a composer object
composeMiddlewares() Middleware<T>
Compose middleware handlers into a single handler
concurrency(List<Middleware<T>> middlewares) Composer<T>
Concurrently launches middleware, the chain will continue if next() is called in all middlewares
enforce(Middleware<T> beforeMiddleware, Middleware<T> middleware, Middleware<T> afterMiddleware) Composer<T>
Runs middleware before and after the main
filter(dynamic condition, Middleware<T> filterMiddleware) Composer<T>
Conditionally runs middleware or stops the chain
fork(Middleware<T> middleware) Composer<T>
Runs the middleware at the next event loop and force call next()
lazy(LazyMiddlewareFactory<T> middlewareFactory) Composer<T>
Lazily asynchronously gets middleware
optional(dynamic condition, Middleware<T> optionalMiddleware) Composer<T>
Conditionally runs optional middleware or skips middleware
tap(Middleware<T> middleware) Composer<T>
Runs the middleware and force call next()
use(Middleware<T> middleware) Composer<T>
Adds middleware to the chain
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Methods

builder<Context extends Object>() Composer<Context>
Invokes a new instance of the Composer class