Skip to content

Commit c028b61

Browse files
fix syntax highlightning for jsx
1 parent ce2bab5 commit c028b61

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This project tends to use the simplicity of functional React components and the
1010

1111
## Usage
1212

13-
```javascript
13+
```jsx
1414
import React from 'react';
1515
import Coroutine from 'react-coroutine';
1616
import Posts from 'PostAPI';
@@ -19,9 +19,9 @@ import PostList from 'PostList.react';
1919
async function PostListCo() {
2020
try {
2121
const posts = await Posts.retrieve();
22-
return <PostList posts={posts} />
22+
return <PostList posts={posts} />;
2323
} catch (error) {
24-
return <p>Unable to fetch posts.</p>
24+
return <p>Unable to fetch posts.</p>;
2525
}
2626
}
2727

@@ -34,19 +34,19 @@ For the sake of testability you might want to inject instances into your corouti
3434

3535
You are able to provide `getVariables()` function that receives `props` and `context` and returns an object that will be passed in a coroutine.
3636

37-
```javascript
37+
```jsx
3838
function getVariables(props) {
3939
return {
40-
postsLoader: new PostsLoader(props.userId)
40+
userPosts: new PostsDAO(props.userId)
4141
};
4242
}
4343

44-
async function PostListCo({ postsLoader }) {
44+
async function PostListCo({ userPosts }) {
4545
try {
46-
const posts = await postsLoader.retrieve();
47-
return <PostList posts={posts} />
46+
const posts = await userPosts.retrieve();
47+
return <PostList posts={posts} />;
4848
} catch (error) {
49-
return <p>Unable to fetch posts.</p>
49+
return <p>Unable to fetch posts.</p>;
5050
}
5151
}
5252

0 commit comments

Comments
 (0)