@selfcommunity/react-core 0.4.9-alpha.44 → 0.4.9-alpha.46
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/lib/cjs/hooks/useSCFetchAddressingTagList.d.ts +1 -2
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js +1 -2
- package/lib/cjs/hooks/useSCFetchBroadcastMessages.d.ts +1 -2
- package/lib/cjs/hooks/useSCFetchBroadcastMessages.js +1 -2
- package/lib/cjs/hooks/useSCFetchCommentObject.d.ts +4 -3
- package/lib/cjs/hooks/useSCFetchCommentObject.js +4 -3
- package/lib/cjs/hooks/useSCFetchCustomAdv.d.ts +5 -4
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +5 -4
- package/lib/cjs/hooks/useSCFetchUser.d.ts +3 -2
- package/lib/cjs/hooks/useSCFetchUser.js +3 -2
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.d.ts +4 -3
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.js +4 -3
- package/lib/cjs/hooks/useSCFetchUserProviders.d.ts +4 -3
- package/lib/cjs/hooks/useSCFetchUserProviders.js +4 -3
- package/lib/cjs/hooks/useSCFetchVote.d.ts +6 -0
- package/lib/cjs/hooks/useSCFetchVote.js +6 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +1 -2
- package/lib/esm/hooks/useSCFetchAddressingTagList.js +1 -2
- package/lib/esm/hooks/useSCFetchBroadcastMessages.d.ts +1 -2
- package/lib/esm/hooks/useSCFetchBroadcastMessages.js +1 -2
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts +4 -3
- package/lib/esm/hooks/useSCFetchCommentObject.js +4 -3
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +5 -4
- package/lib/esm/hooks/useSCFetchCustomAdv.js +5 -4
- package/lib/esm/hooks/useSCFetchUser.d.ts +3 -2
- package/lib/esm/hooks/useSCFetchUser.js +3 -2
- package/lib/esm/hooks/useSCFetchUserBlockedBy.d.ts +4 -3
- package/lib/esm/hooks/useSCFetchUserBlockedBy.js +4 -3
- package/lib/esm/hooks/useSCFetchUserProviders.d.ts +4 -3
- package/lib/esm/hooks/useSCFetchUserProviders.js +4 -3
- package/lib/esm/hooks/useSCFetchVote.d.ts +6 -0
- package/lib/esm/hooks/useSCFetchVote.js +6 -0
- package/package.json +6 -6
|
@@ -3,8 +3,7 @@ import { SCTagType } from '@selfcommunity/types';
|
|
|
3
3
|
:::info
|
|
4
4
|
This custom hook is used to fetch the addressing tag list for the session user
|
|
5
5
|
:::
|
|
6
|
-
*
|
|
7
|
-
* @param object.fetch
|
|
6
|
+
* @param fetch
|
|
8
7
|
*/
|
|
9
8
|
export default function useSCFetchAddressingTagList({ fetch }: {
|
|
10
9
|
fetch?: boolean;
|
|
@@ -9,8 +9,7 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
|
9
9
|
:::info
|
|
10
10
|
This custom hook is used to fetch the addressing tag list for the session user
|
|
11
11
|
:::
|
|
12
|
-
*
|
|
13
|
-
* @param object.fetch
|
|
12
|
+
* @param fetch
|
|
14
13
|
*/
|
|
15
14
|
function useSCFetchAddressingTagList({ fetch = false }) {
|
|
16
15
|
const [scAddressingTags, setSCAddressingTags] = (0, react_1.useState)([]);
|
|
@@ -4,8 +4,6 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
4
4
|
/**
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch broadcast messages.
|
|
7
|
-
@param object
|
|
8
|
-
@param object.cacheStrategy
|
|
9
7
|
|
|
10
8
|
:::tip Context can be consumed in this way:
|
|
11
9
|
|
|
@@ -13,6 +11,7 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
13
11
|
const {messages, isLoading} = useSCFetchBroadcastMessages();
|
|
14
12
|
```
|
|
15
13
|
:::
|
|
14
|
+
* @param props
|
|
16
15
|
*/
|
|
17
16
|
declare const useSCFetchBroadcastMessages: (props?: {
|
|
18
17
|
cacheStrategy?: CacheStrategies;
|
|
@@ -21,8 +21,6 @@ const initialData = { results: [], next: broadcastMessagesRefreshUrl, previous:
|
|
|
21
21
|
/**
|
|
22
22
|
:::info
|
|
23
23
|
This custom hook is used to fetch broadcast messages.
|
|
24
|
-
@param object
|
|
25
|
-
@param object.cacheStrategy
|
|
26
24
|
|
|
27
25
|
:::tip Context can be consumed in this way:
|
|
28
26
|
|
|
@@ -30,6 +28,7 @@ const initialData = { results: [], next: broadcastMessagesRefreshUrl, previous:
|
|
|
30
28
|
const {messages, isLoading} = useSCFetchBroadcastMessages();
|
|
31
29
|
```
|
|
32
30
|
:::
|
|
31
|
+
* @param props
|
|
33
32
|
*/
|
|
34
33
|
const useSCFetchBroadcastMessages = (props) => {
|
|
35
34
|
// PROPS
|
|
@@ -5,9 +5,10 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hooks is used to fetch a comment.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
8
|
+
* @param object
|
|
9
|
+
* @param object.id
|
|
10
|
+
* @param object.commentObject
|
|
11
|
+
* @param object.cacheStrategy
|
|
11
12
|
*/
|
|
12
13
|
export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
|
|
13
14
|
id?: number;
|
|
@@ -10,9 +10,10 @@ const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
|
10
10
|
:::info
|
|
11
11
|
This custom hooks is used to fetch a comment.
|
|
12
12
|
:::
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
13
|
+
* @param object
|
|
14
|
+
* @param object.id
|
|
15
|
+
* @param object.commentObject
|
|
16
|
+
* @param object.cacheStrategy
|
|
16
17
|
*/
|
|
17
18
|
function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
18
19
|
const __commentObjectId = commentObject ? commentObject.id : id;
|
|
@@ -5,10 +5,11 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch a custom adv object.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
8
|
+
* @param object
|
|
9
|
+
* @param object.id
|
|
10
|
+
* @param object.position
|
|
11
|
+
* @param object.categoriesId
|
|
12
|
+
* @param object.cacheStrategy
|
|
12
13
|
*/
|
|
13
14
|
export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
|
|
14
15
|
id?: number;
|
|
@@ -11,10 +11,11 @@ const Cache_1 = require("../constants/Cache");
|
|
|
11
11
|
:::info
|
|
12
12
|
This custom hook is used to fetch a custom adv object.
|
|
13
13
|
:::
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
14
|
+
* @param object
|
|
15
|
+
* @param object.id
|
|
16
|
+
* @param object.position
|
|
17
|
+
* @param object.categoriesId
|
|
18
|
+
* @param object.cacheStrategy
|
|
18
19
|
*/
|
|
19
20
|
function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
20
21
|
const [scCustomAdv, setSCCustomAdv] = (0, react_1.useState)(id !== null && cacheStrategy === utils_1.CacheStrategies.CACHE_FIRST && utils_1.LRUCache.get((0, Cache_1.getAdvObjectCacheKey)(id))
|
|
@@ -4,8 +4,9 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch a user object.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.user
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUser({ id, user }: {
|
|
11
12
|
id?: number | string;
|
|
@@ -9,8 +9,9 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
|
9
9
|
:::info
|
|
10
10
|
This custom hook is used to fetch a user object.
|
|
11
11
|
:::
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
12
|
+
* @param object
|
|
13
|
+
* @param object.id
|
|
14
|
+
* @param object.user
|
|
14
15
|
*/
|
|
15
16
|
function useSCFetchUser({ id = null, user = null }) {
|
|
16
17
|
// CONTEXT
|
|
@@ -3,9 +3,10 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
3
3
|
:::info
|
|
4
4
|
This custom hook is used to fetch if a user is blocked by another user.
|
|
5
5
|
:::
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
6
|
+
* @param object
|
|
7
|
+
* @param object.user
|
|
8
|
+
* @param object.blockedByUser
|
|
9
|
+
* @param object.sync
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUserBlockedBy({ user, blockedByUser, sync, }: {
|
|
11
12
|
user: SCUserType;
|
|
@@ -9,9 +9,10 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
|
9
9
|
:::info
|
|
10
10
|
This custom hook is used to fetch if a user is blocked by another user.
|
|
11
11
|
:::
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
12
|
+
* @param object
|
|
13
|
+
* @param object.user
|
|
14
|
+
* @param object.blockedByUser
|
|
15
|
+
* @param object.sync
|
|
15
16
|
*/
|
|
16
17
|
function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
|
|
17
18
|
const [blockedBy, setBlockedBy] = (0, react_1.useState)(null);
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { SCUserProviderAssociationType } from '@selfcommunity/types';
|
|
3
3
|
/**
|
|
4
4
|
:::info
|
|
5
|
-
This custom hook is used to fetch the
|
|
5
|
+
This custom hook is used to fetch the list of user providers.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.providers
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUserProviders({ id, providers }: {
|
|
11
12
|
id: number | string;
|
|
@@ -6,10 +6,11 @@ const api_services_1 = require("@selfcommunity/api-services");
|
|
|
6
6
|
const utils_1 = require("@selfcommunity/utils");
|
|
7
7
|
/**
|
|
8
8
|
:::info
|
|
9
|
-
This custom hook is used to fetch the
|
|
9
|
+
This custom hook is used to fetch the list of user providers.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
11
|
+
* @param object
|
|
12
|
+
* @param object.id
|
|
13
|
+
* @param object.providers
|
|
13
14
|
*/
|
|
14
15
|
function useSCFetchUserProviders({ id, providers = null }) {
|
|
15
16
|
const [scUserProviders, setSCUserProviders] = (0, react_1.useState)(providers || []);
|
|
@@ -31,6 +31,12 @@ interface FetchVoteProps {
|
|
|
31
31
|
:::info
|
|
32
32
|
This custom hook is used to fetch a contribution vote.
|
|
33
33
|
:::
|
|
34
|
+
* @param object
|
|
35
|
+
* @param object.id
|
|
36
|
+
* @param object.contribution
|
|
37
|
+
* @param object.contributionType
|
|
38
|
+
* @param object.onVote
|
|
39
|
+
* @param object.cacheStrategy
|
|
34
40
|
*/
|
|
35
41
|
export default function useSCFetchVote({ id, contribution, contributionType, onVote, cacheStrategy, }: FetchVoteProps): {
|
|
36
42
|
isLoading: boolean;
|
|
@@ -13,6 +13,12 @@ const SCVoteProvider_1 = require("../components/provider/SCVoteProvider");
|
|
|
13
13
|
:::info
|
|
14
14
|
This custom hook is used to fetch a contribution vote.
|
|
15
15
|
:::
|
|
16
|
+
* @param object
|
|
17
|
+
* @param object.id
|
|
18
|
+
* @param object.contribution
|
|
19
|
+
* @param object.contributionType
|
|
20
|
+
* @param object.onVote
|
|
21
|
+
* @param object.cacheStrategy
|
|
16
22
|
*/
|
|
17
23
|
function useSCFetchVote({ id, contribution = null, contributionType, onVote = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
18
24
|
// MEMO
|
|
@@ -3,8 +3,7 @@ import { SCTagType } from '@selfcommunity/types';
|
|
|
3
3
|
:::info
|
|
4
4
|
This custom hook is used to fetch the addressing tag list for the session user
|
|
5
5
|
:::
|
|
6
|
-
*
|
|
7
|
-
* @param object.fetch
|
|
6
|
+
* @param fetch
|
|
8
7
|
*/
|
|
9
8
|
export default function useSCFetchAddressingTagList({ fetch }: {
|
|
10
9
|
fetch?: boolean;
|
|
@@ -7,8 +7,7 @@ import { useSCUser } from '../components/provider/SCUserProvider';
|
|
|
7
7
|
:::info
|
|
8
8
|
This custom hook is used to fetch the addressing tag list for the session user
|
|
9
9
|
:::
|
|
10
|
-
*
|
|
11
|
-
* @param object.fetch
|
|
10
|
+
* @param fetch
|
|
12
11
|
*/
|
|
13
12
|
export default function useSCFetchAddressingTagList({ fetch = false }) {
|
|
14
13
|
const [scAddressingTags, setSCAddressingTags] = useState([]);
|
|
@@ -4,8 +4,6 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
4
4
|
/**
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch broadcast messages.
|
|
7
|
-
@param object
|
|
8
|
-
@param object.cacheStrategy
|
|
9
7
|
|
|
10
8
|
:::tip Context can be consumed in this way:
|
|
11
9
|
|
|
@@ -13,6 +11,7 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
13
11
|
const {messages, isLoading} = useSCFetchBroadcastMessages();
|
|
14
12
|
```
|
|
15
13
|
:::
|
|
14
|
+
* @param props
|
|
16
15
|
*/
|
|
17
16
|
declare const useSCFetchBroadcastMessages: (props?: {
|
|
18
17
|
cacheStrategy?: CacheStrategies;
|
|
@@ -19,8 +19,6 @@ const initialData = { results: [], next: broadcastMessagesRefreshUrl, previous:
|
|
|
19
19
|
/**
|
|
20
20
|
:::info
|
|
21
21
|
This custom hook is used to fetch broadcast messages.
|
|
22
|
-
@param object
|
|
23
|
-
@param object.cacheStrategy
|
|
24
22
|
|
|
25
23
|
:::tip Context can be consumed in this way:
|
|
26
24
|
|
|
@@ -28,6 +26,7 @@ const initialData = { results: [], next: broadcastMessagesRefreshUrl, previous:
|
|
|
28
26
|
const {messages, isLoading} = useSCFetchBroadcastMessages();
|
|
29
27
|
```
|
|
30
28
|
:::
|
|
29
|
+
* @param props
|
|
31
30
|
*/
|
|
32
31
|
const useSCFetchBroadcastMessages = (props) => {
|
|
33
32
|
// PROPS
|
|
@@ -5,9 +5,10 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hooks is used to fetch a comment.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
8
|
+
* @param object
|
|
9
|
+
* @param object.id
|
|
10
|
+
* @param object.commentObject
|
|
11
|
+
* @param object.cacheStrategy
|
|
11
12
|
*/
|
|
12
13
|
export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
|
|
13
14
|
id?: number;
|
|
@@ -8,9 +8,10 @@ import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
|
|
|
8
8
|
:::info
|
|
9
9
|
This custom hooks is used to fetch a comment.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
11
|
+
* @param object
|
|
12
|
+
* @param object.id
|
|
13
|
+
* @param object.commentObject
|
|
14
|
+
* @param object.cacheStrategy
|
|
14
15
|
*/
|
|
15
16
|
export default function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
|
|
16
17
|
const __commentObjectId = commentObject ? commentObject.id : id;
|
|
@@ -5,10 +5,11 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch a custom adv object.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
8
|
+
* @param object
|
|
9
|
+
* @param object.id
|
|
10
|
+
* @param object.position
|
|
11
|
+
* @param object.categoriesId
|
|
12
|
+
* @param object.cacheStrategy
|
|
12
13
|
*/
|
|
13
14
|
export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
|
|
14
15
|
id?: number;
|
|
@@ -8,10 +8,11 @@ import { getAdvObjectCacheKey } from '../constants/Cache';
|
|
|
8
8
|
:::info
|
|
9
9
|
This custom hook is used to fetch a custom adv object.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
11
|
+
* @param object
|
|
12
|
+
* @param object.id
|
|
13
|
+
* @param object.position
|
|
14
|
+
* @param object.categoriesId
|
|
15
|
+
* @param object.cacheStrategy
|
|
15
16
|
*/
|
|
16
17
|
export default function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
|
|
17
18
|
const [scCustomAdv, setSCCustomAdv] = useState(id !== null && cacheStrategy === CacheStrategies.CACHE_FIRST && LRUCache.get(getAdvObjectCacheKey(id))
|
|
@@ -4,8 +4,9 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch a user object.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.user
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUser({ id, user }: {
|
|
11
12
|
id?: number | string;
|
|
@@ -7,8 +7,9 @@ import { useSCUser } from '../components/provider/SCUserProvider';
|
|
|
7
7
|
:::info
|
|
8
8
|
This custom hook is used to fetch a user object.
|
|
9
9
|
:::
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
10
|
+
* @param object
|
|
11
|
+
* @param object.id
|
|
12
|
+
* @param object.user
|
|
12
13
|
*/
|
|
13
14
|
export default function useSCFetchUser({ id = null, user = null }) {
|
|
14
15
|
// CONTEXT
|
|
@@ -3,9 +3,10 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
3
3
|
:::info
|
|
4
4
|
This custom hook is used to fetch if a user is blocked by another user.
|
|
5
5
|
:::
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
6
|
+
* @param object
|
|
7
|
+
* @param object.user
|
|
8
|
+
* @param object.blockedByUser
|
|
9
|
+
* @param object.sync
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUserBlockedBy({ user, blockedByUser, sync, }: {
|
|
11
12
|
user: SCUserType;
|
|
@@ -7,9 +7,10 @@ import { useSCUser } from '../components/provider/SCUserProvider';
|
|
|
7
7
|
:::info
|
|
8
8
|
This custom hook is used to fetch if a user is blocked by another user.
|
|
9
9
|
:::
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
10
|
+
* @param object
|
|
11
|
+
* @param object.user
|
|
12
|
+
* @param object.blockedByUser
|
|
13
|
+
* @param object.sync
|
|
13
14
|
*/
|
|
14
15
|
export default function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
|
|
15
16
|
const [blockedBy, setBlockedBy] = useState(null);
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { SCUserProviderAssociationType } from '@selfcommunity/types';
|
|
3
3
|
/**
|
|
4
4
|
:::info
|
|
5
|
-
This custom hook is used to fetch the
|
|
5
|
+
This custom hook is used to fetch the list of user providers.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.providers
|
|
9
10
|
*/
|
|
10
11
|
export default function useSCFetchUserProviders({ id, providers }: {
|
|
11
12
|
id: number | string;
|
|
@@ -4,10 +4,11 @@ import { UserService } from '@selfcommunity/api-services';
|
|
|
4
4
|
import { Logger } from '@selfcommunity/utils';
|
|
5
5
|
/**
|
|
6
6
|
:::info
|
|
7
|
-
This custom hook is used to fetch the
|
|
7
|
+
This custom hook is used to fetch the list of user providers.
|
|
8
8
|
:::
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
9
|
+
* @param object
|
|
10
|
+
* @param object.id
|
|
11
|
+
* @param object.providers
|
|
11
12
|
*/
|
|
12
13
|
export default function useSCFetchUserProviders({ id, providers = null }) {
|
|
13
14
|
const [scUserProviders, setSCUserProviders] = useState(providers || []);
|
|
@@ -31,6 +31,12 @@ interface FetchVoteProps {
|
|
|
31
31
|
:::info
|
|
32
32
|
This custom hook is used to fetch a contribution vote.
|
|
33
33
|
:::
|
|
34
|
+
* @param object
|
|
35
|
+
* @param object.id
|
|
36
|
+
* @param object.contribution
|
|
37
|
+
* @param object.contributionType
|
|
38
|
+
* @param object.onVote
|
|
39
|
+
* @param object.cacheStrategy
|
|
34
40
|
*/
|
|
35
41
|
export default function useSCFetchVote({ id, contribution, contributionType, onVote, cacheStrategy, }: FetchVoteProps): {
|
|
36
42
|
isLoading: boolean;
|
|
@@ -11,6 +11,12 @@ import { useSCVote } from '../components/provider/SCVoteProvider';
|
|
|
11
11
|
:::info
|
|
12
12
|
This custom hook is used to fetch a contribution vote.
|
|
13
13
|
:::
|
|
14
|
+
* @param object
|
|
15
|
+
* @param object.id
|
|
16
|
+
* @param object.contribution
|
|
17
|
+
* @param object.contributionType
|
|
18
|
+
* @param object.onVote
|
|
19
|
+
* @param object.cacheStrategy
|
|
14
20
|
*/
|
|
15
21
|
export default function useSCFetchVote({ id, contribution = null, contributionType, onVote = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
|
|
16
22
|
// MEMO
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfcommunity/react-core",
|
|
3
|
-
"version": "0.4.9-alpha.
|
|
3
|
+
"version": "0.4.9-alpha.46",
|
|
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,10 +68,10 @@
|
|
|
68
68
|
"react-intl": "^6.4.7"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@selfcommunity/api-services": "^0.4.9-alpha.
|
|
72
|
-
"@selfcommunity/react-i18n": "^0.5.9-alpha.
|
|
73
|
-
"@selfcommunity/types": "^0.5.9-alpha.
|
|
74
|
-
"@selfcommunity/utils": "^0.2.9-alpha.
|
|
71
|
+
"@selfcommunity/api-services": "^0.4.9-alpha.19",
|
|
72
|
+
"@selfcommunity/react-i18n": "^0.5.9-alpha.25",
|
|
73
|
+
"@selfcommunity/types": "^0.5.9-alpha.12",
|
|
74
|
+
"@selfcommunity/utils": "^0.2.9-alpha.1",
|
|
75
75
|
"js-cookie": "^3.0.5",
|
|
76
76
|
"pubsub-js": "^1.9.4",
|
|
77
77
|
"use-deep-compare-effect": "^1.8.1",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"bugs": {
|
|
126
126
|
"url": "https://github.com/selfcommunity/community-js/issues"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "0098b014f6c947da317ff96fb0809ad65edff179"
|
|
129
129
|
}
|