Skip to content

Commit 6ff30aa

Browse files
author
realign
committedJul 26, 2020
re:publish first full version
1 parent 71182d8 commit 6ff30aa

File tree

8 files changed

+90
-6
lines changed

8 files changed

+90
-6
lines changed
 

‎code/rax/thin-d.ts.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ const fs = require('fs-extra');
33
const ROOT = `${__dirname}/../..`;
44
const copyPath = `${ROOT}/packages/hooksux-rax/dist/rax/src/rax.d.ts`;
55
const copy2Path = `${ROOT}/packages/hooksux-rax/dist/rax.d.ts`;
6+
const copyPathTypes = `${ROOT}/packages/hooksux-rax/dist/rax/src/types`;
7+
const copy2PathTypes = `${ROOT}/packages/hooksux-rax/dist/types`;
68
const removePath = `${ROOT}/packages/hooksux-rax/dist/rax`;
79

810
fs.copySync(copyPath, copy2Path);
911
console.log(`Copy '/dist/rax/src/rax.d.ts' to '/dist/rax.d.ts' success.`);
1012

13+
fs.copySync(copyPathTypes, copy2PathTypes);
14+
console.log(`Copy '/dist/rax/src/types' to '/dist/types' success.`);
15+
1116
fs.removeSync(removePath);
1217
console.log(`Remove '/dist/rax' success.`);

‎code/react/thin-d.ts.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ const fs = require('fs-extra');
33
const ROOT = `${__dirname}/../..`;
44
const copyPath = `${ROOT}/packages/hooksux/dist/react/src/react.d.ts`;
55
const copy2Path = `${ROOT}/packages/hooksux/dist/react.d.ts`;
6+
const copyPathTypes = `${ROOT}/packages/hooksux/dist/react/src/types`;
7+
const copy2PathTypes = `${ROOT}/packages/hooksux/dist/types`;
68
const removePath = `${ROOT}/packages/hooksux/dist/react`;
79

810
fs.copySync(copyPath, copy2Path);
911
console.log(`Copy '/dist/react/src/react.d.ts' to '/dist/react.d.ts' success.`);
1012

13+
fs.copySync(copyPathTypes, copy2PathTypes);
14+
console.log(`Copy '/dist/react/src/types' to '/dist/types' success.`);
15+
1116
fs.removeSync(removePath);
1217
console.log(`Remove '/dist/react' success.`);

‎packages/hooksux-rax/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ Refer to the [NPM - hooksux][npm-hooksux] or [Github - hooksux][github-hooksux]
1919
Refer to the [NPM - hooksux][npm-hooksux] or [Github - hooksux][github-hooksux]
2020

2121
[npm-hooksux]:https://www.npmjs.com/package/hooksux
22-
[github-hooksux]:https://github.com/ReAlign/hooksux/tree/master/packages/hooksux
22+
[github-hooksux]:https://github.com/ReAlign/hooksux/tree/master/packages/hooksux
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
interface OBJ_ANY {
2+
[propName: string]: any;
3+
}
4+
export interface IF_OBJ_ANY extends OBJ_ANY {
5+
}
6+
export interface IF_TOOLS {
7+
typeOf(o: any): string;
8+
isObject(o: any): boolean;
9+
isArray(o: any): boolean;
10+
isNull(o: any): boolean;
11+
isUndefined(o: any): boolean;
12+
deepMerge(targetObj: any, sourceObj: any): any;
13+
checkParams(reducers: IF_REDUCERS, Context: IF_OBJ_ANY, options: IF_OPTIONS): IF_CHECK_RES;
14+
}
15+
export interface IF_STATE extends OBJ_ANY {
16+
}
17+
export interface IF_REDUCERS {
18+
name: string;
19+
reducer: Function;
20+
initState: OBJ_ANY;
21+
}
22+
export interface IF_OPTIONS {
23+
cover?: boolean;
24+
}
25+
export interface IF_CHECK_RES {
26+
code: number;
27+
msg: string;
28+
}
29+
export interface IF_ACTION {
30+
type: string;
31+
payload: OBJ_ANY;
32+
}
33+
export {};

‎packages/hooksux-rax/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hooksux-rax",
3-
"version": "0.0.1-alpha.3",
3+
"version": "0.1.0",
44
"description": "Simple global store manager for rax react hooks.",
55
"author": "ReAlign <realign@yeah.net> (https://github.com/realign)",
66
"private": false,

‎packages/hooksux/README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Origin state, default is `{}`.
4545

4646
| Key | Required | Default | Note |
4747
|-----------|----------|--------------|-----------|
48-
| cover | No | false | Cover exist store when initStore. Common scene is spa-route-switch |
48+
| cover | No | false | Cover existing store when call `initStore`. Common scene is spa-route-switch |
4949

5050
### getContext
5151

@@ -99,7 +99,7 @@ export default () => {
9999
};
100100
```
101101

102-
### Data.js
102+
### data.js
103103

104104
```js
105105
export default {
@@ -133,6 +133,8 @@ export default () => {
133133
},
134134
}
135135
});
136+
// `payload` can be array.
137+
// When it's array, `dispatch` will call `type` in turn for array's item.
136138
};
137139
return (
138140
<div className="Child">
@@ -188,4 +190,10 @@ Then set `Data = { name, reducer: YourReducer, initState, }`.
188190

189191
## Releases
190192

191-
[path-of-useContext-useReducer-hooks]:https://github.com/ReAlign/hooksux/tree/master/docs/useContext-useReducer-hooks.md
193+
### 0.1.x
194+
195+
#### 0.1.0
196+
197+
* publish first `Full Version`
198+
199+
[path-of-useContext-useReducer-hooks]:https://github.com/ReAlign/hooksux/tree/master/docs/useContext-useReducer-hooks.md
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
interface OBJ_ANY {
2+
[propName: string]: any;
3+
}
4+
export interface IF_OBJ_ANY extends OBJ_ANY {
5+
}
6+
export interface IF_TOOLS {
7+
typeOf(o: any): string;
8+
isObject(o: any): boolean;
9+
isArray(o: any): boolean;
10+
isNull(o: any): boolean;
11+
isUndefined(o: any): boolean;
12+
deepMerge(targetObj: any, sourceObj: any): any;
13+
checkParams(reducers: IF_REDUCERS, Context: IF_OBJ_ANY, options: IF_OPTIONS): IF_CHECK_RES;
14+
}
15+
export interface IF_STATE extends OBJ_ANY {
16+
}
17+
export interface IF_REDUCERS {
18+
name: string;
19+
reducer: Function;
20+
initState: OBJ_ANY;
21+
}
22+
export interface IF_OPTIONS {
23+
cover?: boolean;
24+
}
25+
export interface IF_CHECK_RES {
26+
code: number;
27+
msg: string;
28+
}
29+
export interface IF_ACTION {
30+
type: string;
31+
payload: OBJ_ANY;
32+
}
33+
export {};

‎packages/hooksux/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hooksux",
3-
"version": "0.0.1-alpha.3",
3+
"version": "0.1.0",
44
"description": "Simple global store manager for react hooks.",
55
"author": "ReAlign <realign@yeah.net> (https://github.com/realign)",
66
"private": false,

0 commit comments

Comments
 (0)
Please sign in to comment.