Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lake2 committed Mar 18, 2020
1 parent 2d881c0 commit 720551e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ imdux推荐两种异步操作解决办法:

```js
// 定义一个名称为news的action,并使用createStore初始化

import { createAction } from "imdux";

const initialState = {
Expand Down Expand Up @@ -291,6 +292,7 @@ export const news = createAction({ initialState, reducers });

```js
// 使用Dispatch.news.addPage更新news.page,触发request异步操作

import * as React from "react";
import { useSelector } from "react-redux";

Expand Down Expand Up @@ -325,9 +327,9 @@ export default function App() {

return (
<div onScroll={Dispatch.news.addPage}>
{news.list.map(item => (
{news.list.map(item =>
<h1 key={item.key}>{item.title}</h1>
))}
)}
{news.isLoading ? "加载中" : ""}
</div>
);
Expand Down

0 comments on commit 720551e

Please sign in to comment.