@@ -77,10 +77,16 @@ const userOneTodos = await TodoResource.getList({ userId: 1 });
77
77
const newTodo = await TodoResource .getList .push ({ title: ' my todo' });
78
78
79
79
// POST https://jsonplaceholder.typicode.com/todos?userId=1
80
- const newUserOneTodo = await TodoResource .getList .push ({ userId: 1 }, { title: ' my todo' });
80
+ const newUserOneTodo = await TodoResource .getList .push (
81
+ { userId: 1 },
82
+ { title: ' my todo' },
83
+ );
81
84
82
85
// GET https://jsonplaceholder.typicode.com/todos?userId=1&page=2
83
- const nextPageOfTodos = await TodoResource .getList .getPage ({ userId: 1 , page: 2 });
86
+ const nextPageOfTodos = await TodoResource .getList .getPage ({
87
+ userId: 1 ,
88
+ page: 2 ,
89
+ });
84
90
85
91
// PUT https://jsonplaceholder.typicode.com/todos/5
86
92
todo5 = await TodoResource .update ({ id: 5 }, { title: ' my todo' });
@@ -108,10 +114,11 @@ const todoList = useSuspense(TodoResource.getList);
108
114
``` typescript
109
115
const ctrl = useController ();
110
116
const updateTodo = data => ctrl .fetch (TodoResource .update , { id }, data );
111
- const partialUpdateTodo= data =>
117
+ const partialUpdateTodo = data =>
112
118
ctrl .fetch (TodoResource .partialUpdate , { id }, data );
113
119
const addTodoToEnd = data => ctrl .fetch (TodoResource .getList .push , data );
114
- const addTodoToBeginning = data => ctrl .fetch (TodoResource .getList .unshift , data );
120
+ const addTodoToBeginning = data =>
121
+ ctrl .fetch (TodoResource .getList .unshift , data );
115
122
const deleteTodo = data => ctrl .fetch (TodoResource .delete , { id });
116
123
```
117
124
@@ -120,7 +127,7 @@ const deleteTodo = data => ctrl.fetch(TodoResource.delete, { id });
120
127
``` tsx
121
128
const queryRemainingTodos = new schema .Query (
122
129
TodoResource .getList .schema ,
123
- ( entries ) => entries .filter (( todo ) => ! todo .completed ).length ,
130
+ entries => entries .filter (todo => ! todo .completed ).length ,
124
131
);
125
132
126
133
const allRemainingTodos = useQuery (queryRemainingTodos );
@@ -145,12 +152,12 @@ supports inferring argument types from the path templates.
145
152
- [ Backbone Model] ( https://backbonejs.org/#Model )
146
153
- [ ImmutableJS Record] ( https://immutable-js.github.io/immutable-js/docs/#/Record )
147
154
148
-
149
155
## API
150
156
151
157
#### Networking definition
152
- - [ Endpoints] ( https://dataclient.io/rest/api/Endpoint ) : [ RestEndpoint] ( https://dataclient.io/rest/api/RestEndpoint )
153
- - [ Resources] ( https://dataclient.io/docs/getting-started/resource ) : [ resource()] ( https://dataclient.io/rest/api/resource ) , [ hookifyResource()] ( https://dataclient.io/rest/api/hookifyResource )
158
+
159
+ - [ Endpoints] ( https://dataclient.io/rest/api/Endpoint ) : [ RestEndpoint] ( https://dataclient.io/rest/api/RestEndpoint )
160
+ - [ Resources] ( https://dataclient.io/docs/getting-started/resource ) : [ resource()] ( https://dataclient.io/rest/api/resource ) , [ hookifyResource()] ( https://dataclient.io/rest/api/hookifyResource )
154
161
155
162
<table >
156
163
<caption >
@@ -229,4 +236,4 @@ supports inferring argument types from the path templates.
229
236
<td >memoized custom transforms</td >
230
237
<td align =" center " >✅</td >
231
238
</tr >
232
- </tbody ></table >
239
+ </tbody ></table >
0 commit comments