Skip to content

Commit

Permalink
Merge pull request #1868 from SayBGM/master
Browse files Browse the repository at this point in the history
Quotation marks style unification
  • Loading branch information
mattruby committed Jan 18, 2019
2 parents c74c9f8 + 5237b01 commit 63f2cf5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -88,11 +88,11 @@ MobX adds observable capabilities to existing data structures like objects, arra
This can simply be done by annotating your class properties with the [@observable](http://mobxjs.github.io/mobx/refguide/observable-decorator.html) decorator (ES.Next).

```javascript
import { observable } from "mobx"
import { observable } from 'mobx';

class Todo {
id = Math.random();
@observable title = "";
@observable title = '';
@observable finished = false;
}
```
Expand All @@ -106,11 +106,11 @@ Or you can skip them altoghether, as MobX can be used fine without decorator _sy
Many MobX users prefer the slightly more concise decorator syntax, but the following snippet achieves the same:

```javascript
import { decorate, observable } from "mobx"
import { decorate, observable } from 'mobx';

class Todo {
id = Math.random();
title = "";
title = '';
finished = false;
}
decorate(Todo, {
Expand Down Expand Up @@ -173,7 +173,7 @@ class TodoListView extends Component {
const TodoView = observer(({todo}) =>
<li>
<input
type="checkbox"
type='checkbox'
checked={todo.finished}
onClick={() => todo.finished = !todo.finished}
/>{todo.title}
Expand All @@ -197,7 +197,7 @@ For example the following `autorun` prints a log message each time the amount of

```javascript
autorun(() => {
console.log("Tasks left: " + todos.unfinishedTodoCount)
console.log(`Tasks left: ${ todos.unfinishedTodoCount }`)
})
```

Expand Down Expand Up @@ -227,8 +227,8 @@ There is no technical need for firing events, calling a dispatcher, etc. A React

```javascript
store.todos.push(
new Todo("Get Coffee"),
new Todo("Write simpler code")
new Todo('Get Coffee'),
new Todo('Write simpler code')
);
store.todos[0].finished = true;
```
Expand Down

0 comments on commit 63f2cf5

Please sign in to comment.