Skip to content

Commit

Permalink
chore: Drop p-memoise in favour of Apollo caching (#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Nov 20, 2023
1 parent 359deab commit 14a9bf9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 50 deletions.
1 change: 0 additions & 1 deletion editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"nanoid-good": "^3.1.0",
"natsort": "^2.0.3",
"navi": "^0.15.0",
"p-memoize": "^7.1.1",
"postcode": "^5.1.0",
"prop-types": "^15.8.1",
"ramda": "^0.28.0",
Expand Down
54 changes: 8 additions & 46 deletions editor.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions editor.planx.uk/src/routes/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { TYPES as NodeTypes } from "@planx/components/types";
import gql from "graphql-tag";
import { hasFeatureFlag } from "lib/featureFlags";
import { NaviRequest, NotFoundError } from "navi";
import pMemoize from "p-memoize";
import { useStore } from "pages/FlowEditor/lib/store";
import { ApplicationPath } from "types";

Expand Down Expand Up @@ -69,11 +68,12 @@ const QUERY_GET_TEAM_BY_DOMAIN = gql`
query GetTeamByDomain($domain: String!) {
teams(limit: 1, where: { domain: { _eq: $domain } }) {
slug
id
}
}
`;

export const getTeamFromDomain = pMemoize(async (domain: string) => {
export const getTeamFromDomain = async (domain: string) => {
const {
data: { teams },
} = await publicClient.query({
Expand All @@ -84,7 +84,7 @@ export const getTeamFromDomain = pMemoize(async (domain: string) => {
});

return teams?.[0]?.slug;
});
};

/**
* Prevents accessing a different team than the one associated with the custom domain.
Expand Down

0 comments on commit 14a9bf9

Please sign in to comment.