Last active
June 29, 2021 10:42
-
-
Save PreyeaRegmi/b31dd9f47c379efa107bc9111dca2b31 to your computer and use it in GitHub Desktop.
Base use-case class in the application layer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class BaseUseCase<P, R> { | |
Stream<R> buildUseCase(P param); | |
StreamSubscription<R> execute(P param,void Function(R) result,void Function(String) error) | |
{ | |
return buildUseCase(param).listen(result,onError: (Object exception, StackTrace stackTrace){ | |
error(exception.toString()); | |
}); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment