Initial conversion
This commit is contained in:
parent
9d5e7b14a7
commit
e5a79f9d9c
|
@ -1,8 +1,9 @@
|
|||
import { get, derived } from "svelte/store"
|
||||
import { FieldType, UILogicalOperator } from "@budibase/types"
|
||||
import { Store as StoreContext } from "."
|
||||
import { memo } from "../../../utils/memo"
|
||||
|
||||
export const createStores = context => {
|
||||
export const createStores = (context: StoreContext) => {
|
||||
const { props } = context
|
||||
|
||||
// Initialise to default props
|
||||
|
@ -15,7 +16,7 @@ export const createStores = context => {
|
|||
}
|
||||
}
|
||||
|
||||
export const deriveStores = context => {
|
||||
export const deriveStores = (context: StoreContext) => {
|
||||
const { filter, inlineFilters } = context
|
||||
const allFilters = derived(
|
||||
[filter, inlineFilters],
|
||||
|
@ -48,7 +49,7 @@ export const deriveStores = context => {
|
|||
}
|
||||
}
|
||||
|
||||
export const createActions = context => {
|
||||
export const createActions = (context: StoreContext) => {
|
||||
const { filter, inlineFilters } = context
|
||||
|
||||
const addInlineFilter = (column, value) => {
|
||||
|
@ -95,7 +96,7 @@ export const createActions = context => {
|
|||
}
|
||||
}
|
||||
|
||||
export const initialise = context => {
|
||||
export const initialise = (context: StoreContext) => {
|
||||
const { filter, initialFilter } = context
|
||||
|
||||
// Reset filter when initial filter prop changes
|
|
@ -86,6 +86,7 @@ export type Store = BaseStore &
|
|||
selectedRowCount: Writable<any>
|
||||
selectedCellMap: Writable<any>
|
||||
selectedCellCount: Writable<any>
|
||||
props: Writable<any>
|
||||
}
|
||||
|
||||
export const attachStores = (context: Store): Store => {
|
||||
|
|
Loading…
Reference in New Issue