44 lines
2.1 KiB
TypeScript
44 lines
2.1 KiB
TypeScript
// Metro module 12056 (f12057).
|
|
import _slicedToArray from "../../_bundle/_slicedToArray";
|
|
import GameRelationshipStore from "./GameRelationshipStore";
|
|
import { RelationshipTypes } from "../../Constants";
|
|
import { useStateFromStores } from "../../_bundle/Module589";
|
|
import { isVersionEqual } from "../../utils/SecondaryIndexMapUtils";
|
|
function $mk88726($env) {
|
|
return () => {
|
|
const r0 = $env;
|
|
const r2 = $env.$parent[3];
|
|
return [r2.getGameRelationshipsForUserByType(r0[0], r0[1]), r2.getGameRelationshipsVersion()];
|
|
};
|
|
}
|
|
let env8292 = {};
|
|
export function useGameRelationshipsByType(a0) {
|
|
return _slicedToArray(useStateFromStores([GameRelationshipStore], () => [GameRelationshipStore.getGameRelationshipsByType(a0), GameRelationshipStore.getGameRelationshipsVersion()], [a0], isVersionEqual), 1)[0];
|
|
}
|
|
export function useGameFriendsForUser(a0) {
|
|
let env19370;
|
|
const FRIEND = RelationshipTypes.FRIEND;
|
|
const r17 = env19370 = {
|
|
$parent: env8292
|
|
};
|
|
env19370[0] = a0;
|
|
env19370[1] = FRIEND;
|
|
return _slicedToArray(useStateFromStores([GameRelationshipStore], $mk88726(r17), [FRIEND, a0], isVersionEqual), 1)[0];
|
|
}
|
|
export function useIncomingGameRelationshipsForUser(a0) {
|
|
let env19371;
|
|
const PENDING_INCOMING = RelationshipTypes.PENDING_INCOMING;
|
|
const r17 = env19371 = {
|
|
$parent: env8292
|
|
};
|
|
env19371[0] = a0;
|
|
env19371[1] = PENDING_INCOMING;
|
|
return _slicedToArray(useStateFromStores([GameRelationshipStore], $mk88726(r17), [PENDING_INCOMING, a0], isVersionEqual), 1)[0];
|
|
}
|
|
export function useHasGameRelationshipsForUser(a0) {
|
|
return _slicedToArray(useStateFromStores([GameRelationshipStore], () => [GameRelationshipStore.getGameRelationshipsForUser(a0).length > 0, GameRelationshipStore.getGameRelationshipsVersion()], [a0], isVersionEqual), 1)[0];
|
|
}
|
|
export function useHasGameRelationshipsForUserByType(a0, a1) {
|
|
return _slicedToArray(useStateFromStores([GameRelationshipStore], () => [GameRelationshipStore.getGameRelationshipsForUserByType(a0, a1).length > 0, GameRelationshipStore.getGameRelationshipsVersion()], [a1, a0], isVersionEqual), 1)[0];
|
|
}
|