Created
January 31, 2021 14:01
-
-
Save alphamikle/e8d6cc6a3ff227c7809ad8aa0d8dce0d to your computer and use it in GitHub Desktop.
Frontend with backend
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 | |
Future<void> decrement([int diff = 1]) async { | |
counter = await runBackendMethod<int, int>(Events.decrement, diff); | |
} | |
/// ----- | |
/// Backend part | |
Future<int> _decrement(int diff) async { | |
counter -= diff; | |
return counter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment