From 4d417a6aee572c714872bbea32d143d463576abc Mon Sep 17 00:00:00 2001 From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:26:40 -0500 Subject: [PATCH] re add get & set functions --- packages/atomic/src/components/common/interface/store.ts | 7 +++++++ .../src/components/search/atomic-search-interface/store.ts | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/atomic/src/components/common/interface/store.ts b/packages/atomic/src/components/common/interface/store.ts index 433143d654..106020ca01 100644 --- a/packages/atomic/src/components/common/interface/store.ts +++ b/packages/atomic/src/components/common/interface/store.ts @@ -11,6 +11,13 @@ import {AnyEngineType} from './bindings'; export interface CommonStore { state: StoreData; + get: ( + propName: PropName + ) => StoreData[PropName]; + set: ( + propName: PropName, + value: StoreData[PropName] + ) => void; onChange: ( propName: PropName, cb: (newValue: StoreData[PropName]) => void diff --git a/packages/atomic/src/components/search/atomic-search-interface/store.ts b/packages/atomic/src/components/search/atomic-search-interface/store.ts index e42f712a68..b8d1b23998 100644 --- a/packages/atomic/src/components/search/atomic-search-interface/store.ts +++ b/packages/atomic/src/components/search/atomic-search-interface/store.ts @@ -13,7 +13,6 @@ import { } from '../../common/facets/facet-common-store'; import { BaseStore, - CommonStore, createBaseStore, getFacetElements, registerFacet, @@ -82,7 +81,7 @@ export function createSearchStore(): SearchStore { facetElements: [], fieldsToInclude: [], sortOptions: [], - }) as CommonStore; + }); return { ...store,