Skip to content

Commit de2ec31

Browse files
committed
[optimize] List Model supports Async Iteration
[optimize] update Upstream packages & Read Me document
1 parent f85f1b8 commit de2ec31

File tree

5 files changed

+140
-160
lines changed

5 files changed

+140
-160
lines changed

ReadMe.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ import { Buffer } from 'mobx-restful';
136136
import { client } from './client';
137137
import { Repository, RepositoryModel } from './Repository';
138138

139-
export class PreloadRepositoryModel extends Buffer<Repository>(
140-
RepositoryModel
141-
) {
139+
export class PreloadRepositoryModel extends Buffer<Repository>(RepositoryModel) {
142140
client = client;
143141
baseURI = 'orgs/idea2app/repos';
144142

@@ -174,9 +172,7 @@ export class MultipleRepository extends Stream<Repository>(RepositoryModel) {
174172
this.totalCount = public_repos;
175173

176174
for (let i = 1; ; i++) {
177-
const { body } = await this.client.get<Repository[]>(
178-
'orgs/idea2app/repos?page=' + i
179-
);
175+
const { body } = await this.client.get<Repository[]>('orgs/idea2app/repos?page=' + i);
180176
if (!body[0]) break;
181177

182178
yield* body;
@@ -191,20 +187,15 @@ export class MultipleRepository extends Stream<Repository>(RepositoryModel) {
191187
this.totalCount = public_repos;
192188

193189
for (let i = 1; ; i++) {
194-
const { body } = await this.client.get<Repository[]>(
195-
'users/TechQuery/repos?page=' + i
196-
);
190+
const { body } = await this.client.get<Repository[]>('users/TechQuery/repos?page=' + i);
197191
if (!body[0]) break;
198192

199193
yield* body;
200194
}
201195
}
202196

203197
openStream() {
204-
return mergeStream(
205-
this.getOrgRepos.bind(this),
206-
this.getUserRepos.bind(this)
207-
);
198+
return mergeStream(this.getOrgRepos.bind(this), this.getUserRepos.bind(this));
208199
}
209200
}
210201

@@ -341,6 +332,11 @@ export class PartyGiftPage extends HTMLElement {
341332
2. [GitHub](https://github.com/idea2app/MobX-GitHub)
342333
3. [Lark/FeiShu](https://github.com/idea2app/MobX-Lark)
343334

335+
## Utility
336+
337+
1. [Data Migrator](https://github.com/idea2app/MobX-RESTful-migrator)
338+
2. [File Downloader][12]
339+
344340
## Component
345341

346342
1. [Table, List & Form suite](https://github.com/idea2app/MobX-RESTful-table)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-restful",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"license": "LGPL-3.0",
55
"author": "shiy2008@gmail.com",
66
"description": "Common MobX abstract base Class & Decorator utilities for RESTful API",
@@ -55,7 +55,7 @@
5555
"open-cli": "^8.0.0",
5656
"parcel": "~2.15.4",
5757
"prettier": "^3.6.2",
58-
"ts-jest": "^29.4.2",
58+
"ts-jest": "^29.4.4",
5959
"typedoc": "^0.28.13",
6060
"typedoc-plugin-mdn-links": "^5.0.9",
6161
"typescript": "~5.9.2",

pnpm-lock.yaml

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)