fix docs indentation

This commit is contained in:
Javier Gonzalez
2019-10-06 16:28:43 +02:00
parent 89a4f167b0
commit ef83e8cd12
2 changed files with 12 additions and 12 deletions

View File

@@ -833,13 +833,13 @@ import {actionAsync, task} from "mobx-utils"
mobx.configure({ enforceActions: "observed" }) // don't allow state modifications outside actions
class Store {
@observable githubProjects = []
@state = "pending" // "pending" / "done" / "error"
@observable githubProjects = []
@state = "pending" // "pending" / "done" / "error"
@actionAsync
async fetchProjects() {
this.githubProjects = []
this.state = "pending"
@actionAsync
async fetchProjects() {
this.githubProjects = []
this.state = "pending"
try {
// note the use of task when awaiting!
const projects = await task(fetchGithubProjectsSomehow())

View File

@@ -112,13 +112,13 @@ export function actionAsync<F extends (...args: any[]) => Promise<any>>(fn: F):
* mobx.configure({ enforceActions: "observed" }) // don't allow state modifications outside actions
*
* class Store {
* \@observable githubProjects = []
* \@state = "pending" // "pending" / "done" / "error"
* \@observable githubProjects = []
* \@state = "pending" // "pending" / "done" / "error"
*
* \@actionAsync
* async fetchProjects() {
* this.githubProjects = []
* this.state = "pending"
* \@actionAsync
* async fetchProjects() {
* this.githubProjects = []
* this.state = "pending"
* try {
* // note the use of task when awaiting!
* const projects = await task(fetchGithubProjectsSomehow())