From f3ad21e22f704413681ded54e5a8e217c4c6801b Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Fri, 20 May 2022 12:20:31 -0500 Subject: [PATCH] Memoize kind list --- build-lists.js | 2 +- helpers/api/kind.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build-lists.js b/build-lists.js index 5e4341a..0fe0476 100644 --- a/build-lists.js +++ b/build-lists.js @@ -28,7 +28,7 @@ import { writeStorkToml } from '~/helpers/stork/toml.js' import { - KindList + KindListMemoized as KindList } from '~/helpers/api/kind.js' import { apiDirectory diff --git a/helpers/api/kind.js b/helpers/api/kind.js index 83fff98..6195ebc 100644 --- a/helpers/api/kind.js +++ b/helpers/api/kind.js @@ -1,3 +1,5 @@ +import memoizeGetters from 'memoize-getters' + import { apiDirectory } from '~/helpers/api/config.js' @@ -62,3 +64,5 @@ export class KindList extends PaginatedList { } } + +export const KindListMemoized = memoizeGetters( KindList )