Created
January 31, 2021 14:05
-
-
Save alphamikle/b79b1e42fc38dd8b35391065103ed7c2 to your computer and use it in GitHub Desktop.
Backend sync mode
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
class FirstBackend extends Backend<Events, void> { | |
FirstBackend(BackendArgument<void> argument) : super(argument); | |
int counter = 0; | |
/// Or, you can simply return a value | |
Future<int> _decrement(int diff) async { | |
counter -= diff; | |
return counter; | |
} | |
@override | |
Map<Events, Function> get operations => { | |
Events.decrement: _decrement, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment