@sheinx/hooks 3.1.8 → 3.2.0-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/cjs/utils/immer.d.ts +1 -8
- package/cjs/utils/immer.d.ts.map +1 -1
- package/cjs/utils/immer.js +10 -6
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/esm/utils/immer.d.ts +1 -8
- package/esm/utils/immer.d.ts.map +1 -1
- package/esm/utils/immer.js +11 -7
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB,wBAqO3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/cjs/utils/immer.d.ts
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
import { Draft, PatchListener } from 'immer';
|
2
1
|
export { current } from 'immer';
|
3
|
-
declare const
|
4
|
-
type ValidRecipeReturnType<State> = State | void | undefined | (State extends undefined ? typeof NOTHING : never);
|
5
|
-
interface IProduce {
|
6
|
-
<Base, D = Draft<Base>>(// By using a default inferred D, rather than Draft<Base> in the recipe, we can override it.
|
7
|
-
base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): Base;
|
8
|
-
}
|
9
|
-
export declare const produce: IProduce;
|
2
|
+
export declare const produce: <T>(value: T, cb: (value: T) => void) => T;
|
10
3
|
//# sourceMappingURL=immer.d.ts.map
|
package/cjs/utils/immer.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"immer.d.ts","sourceRoot":"","sources":["immer.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"immer.d.ts","sourceRoot":"","sources":["immer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,eAAO,MAAM,OAAO,kCAAmC,IAAI,MAE1D,CAAC"}
|
package/cjs/utils/immer.js
CHANGED
@@ -11,10 +11,14 @@ Object.defineProperty(exports, "current", {
|
|
11
11
|
});
|
12
12
|
exports.produce = void 0;
|
13
13
|
var _immer = require("immer");
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
// import { produce as produce2, getSnapshot } from '@shined/reactive/vanilla';
|
15
|
+
|
16
|
+
// export const produce = ((...args: any) => {
|
17
|
+
// return produce2.apply(null, args);
|
18
|
+
// }) as typeof produce2;
|
19
|
+
|
20
|
+
// export const current = getSnapshot;
|
21
|
+
|
22
|
+
var produce = exports.produce = function produce(value, cb) {
|
23
|
+
return (0, _immer.produce)(value, cb);
|
20
24
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD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B,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB,wBAqO3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/esm/utils/immer.d.ts
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
import { Draft, PatchListener } from 'immer';
|
2
1
|
export { current } from 'immer';
|
3
|
-
declare const
|
4
|
-
type ValidRecipeReturnType<State> = State | void | undefined | (State extends undefined ? typeof NOTHING : never);
|
5
|
-
interface IProduce {
|
6
|
-
<Base, D = Draft<Base>>(// By using a default inferred D, rather than Draft<Base> in the recipe, we can override it.
|
7
|
-
base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): Base;
|
8
|
-
}
|
9
|
-
export declare const produce: IProduce;
|
2
|
+
export declare const produce: <T>(value: T, cb: (value: T) => void) => T;
|
10
3
|
//# sourceMappingURL=immer.d.ts.map
|
package/esm/utils/immer.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"immer.d.ts","sourceRoot":"","sources":["immer.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"immer.d.ts","sourceRoot":"","sources":["immer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,eAAO,MAAM,OAAO,kCAAmC,IAAI,MAE1D,CAAC"}
|
package/esm/utils/immer.js
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
import { produce as produce2,
|
1
|
+
// import { produce as produce2, getSnapshot } from '@shined/reactive/vanilla';
|
2
|
+
|
3
|
+
// export const produce = ((...args: any) => {
|
4
|
+
// return produce2.apply(null, args);
|
5
|
+
// }) as typeof produce2;
|
6
|
+
|
7
|
+
// export const current = getSnapshot;
|
8
|
+
|
9
|
+
import { produce as produce2 } from 'immer';
|
2
10
|
export { current } from 'immer';
|
3
|
-
export var produce = function produce() {
|
4
|
-
|
5
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
6
|
-
args[_key] = arguments[_key];
|
7
|
-
}
|
8
|
-
return produce2.apply(null, args);
|
11
|
+
export var produce = function produce(value, cb) {
|
12
|
+
return produce2(value, cb);
|
9
13
|
};
|