Skip to content

Instantly share code, notes, and snippets.

@alphamikle
Created January 31, 2021 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphamikle/0aaee3c4de4dcb3c94a6491ad6c352f7 to your computer and use it in GitHub Desktop.
Save alphamikle/0aaee3c4de4dcb3c94a6491ad6c352f7 to your computer and use it in GitHub Desktop.
Backend processing
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