@yaasl/preact 0.11.0-alpha.3 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +1 -1
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/{useAtom.js → use-atom.js} +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/{useAtom.js → use-atom.js} +1 -1
- package/package.json +4 -4
- /package/dist/@types/{useAtom.d.ts → use-atom.d.ts} +0 -0
- /package/dist/@types/{useStateful.d.ts → use-stateful.d.ts} +0 -0
- /package/dist/cjs/{useStateful.js → use-stateful.js} +0 -0
- /package/dist/esm/{useStateful.js → use-stateful.js} +0 -0
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useAtom, useSetAtom, useAtomValue, useAtomDidInit } from "./
|
|
1
|
+
export { useAtom, useSetAtom, useAtomValue, useAtomDidInit } from "./use-atom";
|
|
2
2
|
export * from "@yaasl/core";
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,9 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.useAtomDidInit = exports.useAtomValue = exports.useSetAtom = exports.useAtom = void 0;
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "useAtom", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "useSetAtom", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "useAtomValue", { enumerable: true, get: function () { return
|
|
22
|
-
Object.defineProperty(exports, "useAtomDidInit", { enumerable: true, get: function () { return
|
|
18
|
+
var use_atom_1 = require("./use-atom");
|
|
19
|
+
Object.defineProperty(exports, "useAtom", { enumerable: true, get: function () { return use_atom_1.useAtom; } });
|
|
20
|
+
Object.defineProperty(exports, "useSetAtom", { enumerable: true, get: function () { return use_atom_1.useSetAtom; } });
|
|
21
|
+
Object.defineProperty(exports, "useAtomValue", { enumerable: true, get: function () { return use_atom_1.useAtomValue; } });
|
|
22
|
+
Object.defineProperty(exports, "useAtomDidInit", { enumerable: true, get: function () { return use_atom_1.useAtomDidInit; } });
|
|
23
23
|
__exportStar(require("@yaasl/core"), exports);
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useAtom = exports.useAtomDidInit = exports.useSetAtom = exports.useAtomValue = void 0;
|
|
4
4
|
const hooks_1 = require("preact/hooks");
|
|
5
|
-
const
|
|
5
|
+
const use_stateful_1 = require("./use-stateful");
|
|
6
6
|
/** Use an atom's value in the preact lifecycle.
|
|
7
7
|
*
|
|
8
8
|
* @param atom Atom to be used.
|
|
9
9
|
*
|
|
10
10
|
* @returns A stateful value.
|
|
11
11
|
**/
|
|
12
|
-
const useAtomValue = (atom) => (0,
|
|
12
|
+
const useAtomValue = (atom) => (0, use_stateful_1.useStatefulValue)(atom);
|
|
13
13
|
exports.useAtomValue = useAtomValue;
|
|
14
14
|
/** Set an atom's value in the preact lifecycle.
|
|
15
15
|
*
|
|
@@ -17,7 +17,7 @@ exports.useAtomValue = useAtomValue;
|
|
|
17
17
|
*
|
|
18
18
|
* @returns A setter function for the atom.
|
|
19
19
|
**/
|
|
20
|
-
const useSetAtom = (atom) => (0,
|
|
20
|
+
const useSetAtom = (atom) => (0, use_stateful_1.useSetStateful)(atom);
|
|
21
21
|
exports.useSetAtom = useSetAtom;
|
|
22
22
|
/** Use an atom's initialization state in the preact lifecycle.
|
|
23
23
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useAtom, useSetAtom, useAtomValue, useAtomDidInit } from "./
|
|
1
|
+
export { useAtom, useSetAtom, useAtomValue, useAtomDidInit } from "./use-atom";
|
|
2
2
|
export * from "@yaasl/core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from "preact/hooks";
|
|
2
|
-
import { useStatefulValue, useSetStateful } from "./
|
|
2
|
+
import { useStatefulValue, useSetStateful } from "./use-stateful";
|
|
3
3
|
/** Use an atom's value in the preact lifecycle.
|
|
4
4
|
*
|
|
5
5
|
* @param atom Atom to be used.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaasl/preact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "yet another atomic store library (preact)",
|
|
5
5
|
"author": "PrettyCoffee",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"preact": ">=10"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@yaasl/core": "0.
|
|
47
|
-
"@yaasl/utils": "0.
|
|
46
|
+
"@yaasl/core": "^0.12.1",
|
|
47
|
+
"@yaasl/utils": "^0.12.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@testing-library/preact": "^3.2.4",
|
|
51
|
-
"preact": "^10.26.
|
|
51
|
+
"preact": "^10.26.9"
|
|
52
52
|
},
|
|
53
53
|
"lint-staged": {
|
|
54
54
|
"*.{ts,tsx}": [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|