Created
January 31, 2021 14:03
-
-
Save alphamikle/0aaee3c4de4dcb3c94a6491ad6c352f7 to your computer and use it in GitHub Desktop.
Backend processing
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; | |
void _increment(int diff) { | |
counter += diff; | |
send(Events.increment, counter); | |
} | |
@override | |
Map<Events, Function> get operations => { | |
Events.increment: _increment, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment