Middleware<T> constructor Null safety

Middleware<T>()

Constructor

The type of the Middleware must be wither Request or Response. Use the constructor ONLY if you need to initialize a variable and it is a Singleton. Otherwise, use the onInit method.

Implementation

Middleware() : assert(T == Request || T == Response);