Skip to content

Instantly share code, notes, and snippets.

@machinescream
Last active February 8, 2019 19:15
Show Gist options
  • Save machinescream/c9f837cdaa0f7984c2fbf9cf7231bd54 to your computer and use it in GitHub Desktop.
Save machinescream/c9f837cdaa0f7984c2fbf9cf7231bd54 to your computer and use it in GitHub Desktop.
Mutator
import 'state.dart';
enum Actions{ Increment }
class Mutator {
mutateState(action) {
switch(action){
case Actions.Increment : {
state.valueElementState.value++;
state.valueElementState.valueBroadcaster
.add(state.valueElementState.value.toString());
break;
}
}
}
}
final mutator = Mutator();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment