Created
January 31, 2021 14:02
-
-
Save alphamikle/82f39159c00f147ed68a17f482f10ef5 to your computer and use it in GitHub Desktop.
Tasks and operations
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
/// Frontend part | |
/// This block is responsible for handling events from the isolate. | |
@override | |
Map<Events, Function> get tasks => { | |
Events.increment: _setCounter, | |
Events.decrement: _setCounter, | |
Events.error: _setCounter, | |
}; | |
/// ----- | |
/// Backend part | |
/// And this one is for handling events from the main thread | |
@override | |
Map<Events, Function> get operations => { | |
Events.increment: _increment, | |
Events.decrement: _decrement, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment