Export stores

This commit is contained in:
Adria Navarro 2024-12-24 14:13:41 +01:00
parent e5a79f9d9c
commit c682a43d9a
2 changed files with 15 additions and 6 deletions

View File

@ -1,9 +1,20 @@
import { get, derived } from "svelte/store"
import { get, derived, Writable } from "svelte/store"
import { FieldType, UILogicalOperator } from "@budibase/types"
import { Store as StoreContext } from "."
import { memo } from "../../../utils/memo"
export const createStores = (context: StoreContext) => {
export interface FilterStore {
filter: Writable<any>
inlineFilters: Writable<any>
}
export interface FilterDerivedStore {
allFilters: Writable<any>
}
export type Store = FilterStore & FilterDerivedStore
export const createStores = (context: StoreContext): FilterStore => {
const { props } = context
// Initialise to default props

View File

@ -63,12 +63,10 @@ export type Store = BaseStore &
Datasource.Store &
Validation.Store &
Users.Store &
Menu.Store & {
Menu.Store &
Filter.Store & {
// TODO while typing the rest of stores
fetch: Writable<any>
filter: Writable<any>
inlineFilters: Writable<any>
allFilters: Writable<any>
sort: Writable<any>
initialFilter: Writable<any>
initialSortColumn: Writable<any>