@selfcommunity/react-core 0.7.0-alpha.19 → 0.7.0-alpha.20
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.
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
6
6
|
*
|
|
7
7
|
* Ex.
|
|
8
|
-
* const customValue = useSCPreference
|
|
9
|
-
* const numericValue = useSCPreference
|
|
8
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
9
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
10
10
|
*/
|
|
11
11
|
declare function useSCPreference<T = any>(preferenceKey: string, defaultValue?: T): T | undefined;
|
|
12
12
|
/**
|
|
@@ -10,8 +10,8 @@ const SCPreferencesProvider_1 = require("../components/provider/SCPreferencesPro
|
|
|
10
10
|
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
11
11
|
*
|
|
12
12
|
* Ex.
|
|
13
|
-
* const customValue = useSCPreference
|
|
14
|
-
* const numericValue = useSCPreference
|
|
13
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
14
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
15
15
|
*/
|
|
16
16
|
function useSCPreference(preferenceKey, defaultValue) {
|
|
17
17
|
const { preferences } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
6
6
|
*
|
|
7
7
|
* Ex.
|
|
8
|
-
* const customValue = useSCPreference
|
|
9
|
-
* const numericValue = useSCPreference
|
|
8
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
9
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
10
10
|
*/
|
|
11
11
|
declare function useSCPreference<T = any>(preferenceKey: string, defaultValue?: T): T | undefined;
|
|
12
12
|
/**
|
|
@@ -7,8 +7,8 @@ import { useSCPreferences } from '../components/provider/SCPreferencesProvider';
|
|
|
7
7
|
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
8
8
|
*
|
|
9
9
|
* Ex.
|
|
10
|
-
* const customValue = useSCPreference
|
|
11
|
-
* const numericValue = useSCPreference
|
|
10
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
11
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
12
12
|
*/
|
|
13
13
|
function useSCPreference(preferenceKey, defaultValue) {
|
|
14
14
|
const { preferences } = useSCPreferences();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfcommunity/react-core",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
3
|
+
"version": "0.7.0-alpha.20",
|
|
4
4
|
"description": "React Core Components useful for integrating UI Community components (react-ui).",
|
|
5
5
|
"author": "SelfCommunity <https://www.selfcommunity.com>",
|
|
6
6
|
"homepage": "https://www.selfcommunity.com",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"react-intl": "^6.4.7"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@selfcommunity/api-services": "^0.7.0-alpha.
|
|
71
|
+
"@selfcommunity/api-services": "^0.7.0-alpha.10",
|
|
72
72
|
"@selfcommunity/react-i18n": "^0.8.0-alpha.22",
|
|
73
73
|
"@selfcommunity/types": "^0.8.0-alpha.10",
|
|
74
74
|
"@selfcommunity/utils": "^0.2.64-alpha.2",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"bugs": {
|
|
131
131
|
"url": "https://github.com/selfcommunity/community-js/issues"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "064fce0e2b951dbadfc0ed20276e310571fd6438"
|
|
134
134
|
}
|