Gateway<M extends DomainModel, R extends Request, P extends SuccessResponse, S extends SuccessDomainInput> constructor
Gateway<M extends DomainModel, R extends Request, P extends SuccessResponse, S extends SuccessDomainInput> ({
- ProvidersContext? context,
- UseCaseProvider<
Entity, UseCase< ? provider,Entity> > - UseCase<
Entity> ? useCase,
Implementation
Gateway({
ProvidersContext? context,
UseCaseProvider? provider,
UseCase? useCase,
}) : assert(
() {
return (context != null && provider != null) || useCase != null;
}(),
'',
) {
_useCase = useCase ?? provider!.getUseCaseFromContext(context!);
_useCase.subscribe<M, S>(
(domainModel) => _processRequest(buildRequest(domainModel)),
);
}