Browse Source

ref(ui): Refactor some duplicated types in `PageFiltersStore` (#35017)

There's some duplication here that we can clean up
Billy Vong 2 years ago
parent
commit
3fa115036e
1 changed files with 19 additions and 13 deletions
  1. 19 13
      static/app/stores/pageFiltersStore.tsx

+ 19 - 13
static/app/stores/pageFiltersStore.tsx

@@ -9,23 +9,12 @@ import {makeSafeRefluxStore} from 'sentry/utils/makeSafeRefluxStore';
 
 import {CommonStoreDefinition} from './types';
 
-type State = {
-  desyncedFilters: Set<PinnedPageFilter>;
-  isReady: boolean;
-  pinnedFilters: Set<PinnedPageFilter>;
-  selection: PageFilters;
-};
-
-type InternalDefinition = {
+interface CommonState {
   /**
    * The set of page filters which have been pinned but do not match the current
    * URL state.
    */
   desyncedFilters: Set<PinnedPageFilter>;
-  /**
-   * Have we initalized page filters?
-   */
-  hasInitialState: boolean;
   /**
    * The set of page filters which are currently pinned
    */
@@ -34,7 +23,24 @@ type InternalDefinition = {
    * The current page filter selection
    */
   selection: PageFilters;
-};
+}
+
+/**
+ * External state
+ */
+interface State extends CommonState {
+  /**
+   * Are page filters ready?
+   */
+  isReady: boolean;
+}
+
+interface InternalDefinition extends CommonState {
+  /**
+   * Have we initalized page filters?
+   */
+  hasInitialState: boolean;
+}
 
 interface PageFiltersStoreDefinition
   extends InternalDefinition,