Skip to content

Commit 78f531e

Browse files
committed
docs: update docs
1 parent 48f0bb8 commit 78f531e

File tree

10 files changed

+417
-191
lines changed

10 files changed

+417
-191
lines changed

.changeset/empty-fans-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mobx-tanstack-query": patch
3+
---
4+
5+
update docs

.github/workflows/version-or-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ jobs:
4949
id: pub-or-release-pr
5050
with:
5151
version: pnpm changeset version
52-
publish: pnpm pub-ci
52+
publish: pnpm pub
5353
env:
54+
CI: true
5455
GITHUB_TOKEN: ${{ github.token }}
5556
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5657
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ const query = new Query({
3131
return await response.json();
3232
}
3333
})
34+
35+
reaction(
36+
() => query.isLoading,
37+
isLoading => {
38+
if (isLoading) {
39+
console.log('Loading...');
40+
}
41+
}
42+
)
3443
```
3544

3645

docs/.vitepress/theme/style.css

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,83 @@ html.dark {
188188

189189
.image-container > .image-src {
190190
animation: logoAnimate 10s linear infinite;
191+
}
192+
193+
.custom-block > .custom-block-title:first-child:last-child {
194+
margin-top: -8px;
195+
}
196+
p:has(>em:first-child:last-child) + div[class*=language-] {
197+
margin-top: -10px;
198+
}
199+
200+
.vp-doc strong a {
201+
font-weight: bold;
202+
}
203+
204+
.vp-doc strong code {
205+
font-weight: bold;
206+
}
207+
208+
.VPHome {
209+
flex: 1;
210+
display: flex;
211+
flex-direction: column;
212+
margin-bottom: 0 !important;
213+
}
214+
215+
.VPContent.is-home {
216+
display: flex;
217+
}
218+
219+
.VPHero.has-image.VPHomeHero {
220+
flex: 1;
221+
display: flex;
222+
flex-direction: column;
223+
}
224+
225+
.VPHero.has-image .main {position: relative;}
226+
227+
.VPHero.has-image .container {
228+
padding-left: 2rem;
229+
padding-right: 2rem;
230+
margin-top: auto;
231+
margin-bottom: auto;
232+
padding-bottom: 7vh;
233+
}
234+
235+
.main > .heading > .text {
236+
font-size: 24px;
237+
line-height: 28px;
238+
padding-top: 20px;
239+
}
240+
241+
html .VPFooter {
242+
border-top: 0 !important;
243+
}
244+
245+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPHero.has-image .container {
246+
margin-bottom: 0;
247+
margin-top: auto;
248+
}
249+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPHero.has-image.VPHomeHero {
250+
flex: 1;
251+
}
252+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPFeatures.VPHomeFeatures {
253+
margin-bottom: auto;
254+
flex: 1;
255+
}
256+
257+
html.gh-preview .main > .heading > .name {
258+
line-height: 72px;
259+
font-size: 68px;
260+
}
261+
html.gh-preview .main > .heading > .text {
262+
font-size: 43px;
263+
line-height: 48px;
264+
}
265+
html.gh-preview .main > .actions {
266+
opacity: 0;
267+
}
268+
html.gh-preview .VPFeatures.VPHomeFeatures {
269+
opacity: 0;
191270
}

docs/api/Mutation.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,63 @@ console.info(result.data, result.isPending, result.isError);
4040

4141
```
4242

43+
## Properties and methods
44+
45+
#### `data: TData | undefined`
46+
47+
The last successfully resolved data for the mutation.
48+
49+
Example:
50+
51+
```ts
52+
const mutation = new Mutation({
53+
queryClient,
54+
mutationFn: async () => api.updatePet(),
55+
});
56+
57+
mutation.data; // updated pet or undefined
58+
```
59+
60+
#### `error: TError | null`
61+
62+
The error object for the mutation, if an error was encountered.
63+
64+
#### `variables`
65+
66+
The last variables that were passed to the mutation function.
67+
68+
#### `isError`
69+
A boolean variable derived from `status`. Will be `true` if the last mutation attempt resulted in an error.
70+
71+
#### `isIdle`
72+
A boolean variable derived from `status`. Will be `true` if the mutation is in its initial state prior to executing.
73+
74+
#### `isPending`
75+
A boolean variable derived from `status`. Will be `true` if the mutation is currently executing.
76+
77+
#### `isSuccess`
78+
A boolean variable derived from `status`. Will be `true` if the last mutation attempt was successful.
79+
80+
#### `status`
81+
The status of the mutation.
82+
- Will be:
83+
- `idle` initial status prior to the mutation function executing.
84+
- `pending` if the mutation is currently executing.
85+
- `error` if the last mutation attempt resulted in an error.
86+
- `success` if the last mutation attempt was successful.
87+
88+
#### `failureCount`
89+
The failure count for the mutation. Incremented every time the mutation fails.
90+
91+
#### `failureReason`
92+
The failure reason for the mutation retry.
93+
94+
#### `isPaused`
95+
will be `true` if the mutation has been paused. See [Network Mode](https://tanstack.com/query/v5/docs/framework/react/guides/network-mode) for more information.
96+
97+
#### `submittedAt`
98+
The timestamp for when the mutation was submitted.
99+
43100
## Built-in Features
44101

45102
### `abortSignal` option

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@unocss/preset-icons": "^0.61.9",
77
"unocss": "^0.61.9",
88
"vite": "^5.3.1",
9-
"vitepress": "^1.3.2"
9+
"vitepress": "^1.6.4"
1010
},
1111
"scripts": {
1212
"dev": "vitepress dev",

docs/pnpm-lock.yaml

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

package.json

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
"clean": "rimraf dist",
77
"check": "eslint . --fix",
88
"prebuild": "npm run clean && npm run check",
9-
"build:watch": "pnpm build && nodemon --watch src --ext ts --exec \"tsc && node ./post-build.mjs\"",
10-
"build": "tsc && node ./post-build.mjs",
11-
"pub": "PUBLISH=true pnpm run build",
12-
"pub-ci": "PUBLISH=true CI=true pnpm run build",
13-
"pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
14-
"pub:minor": "PUBLISH=true PUBLISH_VERSION=minor pnpm run build",
15-
"pub:major": "PUBLISH=true PUBLISH_VERSION=major pnpm run build",
9+
"build:watch": "pnpm build && nodemon --watch src --ext ts,tsx --exec \"pnpm build\"",
10+
"build": "zshy",
11+
"pub": "pnpm build && sborshik publish",
12+
"pub:patch": "PUBLISH_VERSION=patch pnpm pub",
13+
"pub:minor": "PUBLISH_VERSION=minor pnpm pub",
14+
"pub:major": "PUBLISH_VERSION=major pnpm pub",
1615
"test": "vitest run",
1716
"test:watch": "vitest watch",
1817
"test:coverage": "vitest run --coverage",
@@ -33,6 +32,12 @@
3332
"author": "js2me",
3433
"license": "MIT",
3534
"description": "MobX wrappers for Tanstack Query (Core)",
35+
"zshy": {
36+
"exports": {
37+
"./package.json": "./package.json",
38+
".": "./src/index.ts"
39+
}
40+
},
3641
"bugs": {
3742
"url": "https://github.com/js2me/mobx-tanstack-query/issues"
3843
},
@@ -47,7 +52,7 @@
4752
},
4853
"dependencies": {
4954
"linked-abort-controller": "^1.1.0",
50-
"yummies": "^4.12.2"
55+
"yummies": "^5.4.8"
5156
},
5257
"devDependencies": {
5358
"@changesets/changelog-github": "^0.5.1",
@@ -61,13 +66,28 @@
6166
"commitfmt": "^1.0.0",
6267
"eslint": "^8.57.0",
6368
"js2me-eslint-config": "^1.0.6",
64-
"js2me-exports-post-build-script": "^4.1.5",
69+
"sborshik": "^1.0.6",
6570
"jsdom": "^25.0.1",
6671
"lefthook": "^1.11.13",
6772
"nodemon": "^3.1.0",
6873
"rimraf": "^6.0.1",
69-
"typescript": "^5.4.5",
70-
"vitest": "^2.1.4"
74+
"typescript": "^5.5.0",
75+
"vitest": "^2.1.4",
76+
"zshy": "^0.4.2"
7177
},
72-
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
73-
}
78+
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903",
79+
"files": [
80+
"dist"
81+
],
82+
"main": "./dist/index.js",
83+
"module": "./dist/index.mjs",
84+
"types": "./dist/index.d.ts",
85+
"exports": {
86+
"./package.json": "./package.json",
87+
".": {
88+
"types": "./dist/index.d.ts",
89+
"import": "./dist/index.mjs",
90+
"require": "./dist/index.js"
91+
}
92+
}
93+
}

0 commit comments

Comments
 (0)