chayns-api 2.1.1 → 2.1.2
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/cjs/hooks/useUser.js +1 -4
- package/dist/esm/hooks/useUser.js +1 -4
- package/dist/types/hooks/context.d.ts +2 -2
- package/dist/types/hooks/useCurrentPage.d.ts +2 -1
- package/dist/types/hooks/useCustomCallbackFunction.d.ts +1 -1
- package/dist/types/hooks/useFunctions.d.ts +1 -1
- package/dist/types/hooks/useUser.d.ts +2 -1
- package/dist/types/hooks/useValues.d.ts +1 -1
- package/package.json +3 -2
|
@@ -9,8 +9,5 @@ const empty = {};
|
|
|
9
9
|
/**
|
|
10
10
|
* @category Hooks
|
|
11
11
|
*/
|
|
12
|
-
const useUser = () => (0, _context.useValuesSelector)(v =>
|
|
13
|
-
var _v$user;
|
|
14
|
-
return (_v$user = v.user) !== null && _v$user !== void 0 ? _v$user : empty;
|
|
15
|
-
});
|
|
12
|
+
const useUser = () => (0, _context.useValuesSelector)(v => v.user || empty);
|
|
16
13
|
exports.useUser = useUser;
|
|
@@ -3,7 +3,4 @@ const empty = {};
|
|
|
3
3
|
/**
|
|
4
4
|
* @category Hooks
|
|
5
5
|
*/
|
|
6
|
-
export const useUser = () => useValuesSelector(v =>
|
|
7
|
-
var _v$user;
|
|
8
|
-
return (_v$user = v.user) !== null && _v$user !== void 0 ? _v$user : empty;
|
|
9
|
-
});
|
|
6
|
+
export const useUser = () => useValuesSelector(v => v.user || empty);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IChaynsReact } from '../types/IChaynsReact';
|
|
2
|
-
export declare const useValuesSelector: <Result>(selector: (value: IChaynsReact["values"]) => Result) =>
|
|
3
|
-
export declare const useFunctionsSelector: <Result>(selector: (value: IChaynsReact["functions"]) => Result) =>
|
|
2
|
+
export declare const useValuesSelector: <Result>(selector: (value: IChaynsReact["values"]) => Result) => Result;
|
|
3
|
+
export declare const useFunctionsSelector: <Result>(selector: (value: IChaynsReact["functions"]) => Result) => Result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chayns-api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "new chayns api",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"dev": "npm link && npm run watch",
|
|
32
32
|
"format": "prettier . --write",
|
|
33
33
|
"lint": "eslint src",
|
|
34
|
-
"prepublishOnly": "npm run build:cjs && npm run build:esm && npm run build:typescript"
|
|
34
|
+
"prepublishOnly": "npm run build:cjs && npm run build:esm && npm run build:typescript",
|
|
35
|
+
"preversion": "npm run build:typescript -- --noEmit --emitDeclarationOnly false"
|
|
35
36
|
},
|
|
36
37
|
"prettier": {
|
|
37
38
|
"proseWrap": "always",
|