teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

追加の情報

2020/12/22 06:31

投稿

like-here
like-here

スコア6

title CHANGED
File without changes
body CHANGED
@@ -121,6 +121,48 @@
121
121
  };
122
122
  ```
123
123
 
124
+ **stub**
125
+ ```typescript
126
+ export const data = [
127
+ {
128
+ taskId: 1,
129
+ title: "title",
130
+ description: "description",
131
+ status: "ok",
132
+ createTime: "2020-12-16",
133
+ updateTime: "2020-12-16",
134
+ tag: ["#react", "#redux"],
135
+ },
136
+ {
137
+ taskId: 2,
138
+ title: "title",
139
+ description: "description",
140
+ status: "ok",
141
+ createTime: "2020-12-16",
142
+ updateTime: "2020-12-16",
143
+ tag: ["#react", "typescript"],
144
+ },
145
+ ];
146
+
147
+ ```
148
+
149
+ **action**
150
+ ```typescript
151
+ import axios from "axios";
152
+ import { data } from "./test-stub";
153
+ import { listData } from "../reducer/events";
154
+
155
+ export const READ_EVENTS = "READ_EVENTS";
156
+
157
+ // const ROOT_URL = "http://localhost:3000"
158
+ const ROOT_URL = "https://udemy-utils.herokuapp.com/api/v1";
159
+ const QUERYSTRING = "?token=token123";
160
+
161
+ export async function readEvents(dispatch: any) {
162
+ dispatch({ type: "READ_EVENTS", data });
163
+ }
164
+ ```
165
+
124
166
  **GitHub**
125
167
  [Github](http://github.com/ykobaya14/dcproject0001/tree/feature/clinet-test)
126
168