Skip to content

Instantly share code, notes, and snippets.

@erdemuslu
Created April 24, 2020 14:10
Show Gist options
  • Save erdemuslu/e56d73726981c6cde47bbd488ae1a656 to your computer and use it in GitHub Desktop.
Save erdemuslu/e56d73726981c6cde47bbd488ae1a656 to your computer and use it in GitHub Desktop.
import { action, decorate, observable } from 'mobx';
function Store() {
this.name = 'Ali';
this.updateName = () => {
this.name = 'Mehmet';
};
}
decorate(Store, {
name: observable,
updateName: action,
});
export default new Store();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment