Skip to content

Instantly share code, notes, and snippets.

@shpyo
Created October 13, 2017 11: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 shpyo/b6641846a6607d2ed207fc417ee0989a to your computer and use it in GitHub Desktop.
Save shpyo/b6641846a6607d2ed207fc417ee0989a to your computer and use it in GitHub Desktop.
class SomeClass {
@observable prop1;
@observable prop2;
@action init(prop1, prop2) {
this.setProp1(prop1); // or this.prop1 = prop1; ?
this.setProp2(prop2); // or this.prop2 = prop2; ?
}
@action
setProp1(value) {
this.prop1 = value;
}
@action
setProp2(value) {
this.prop2 = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment