mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 00:06:06 +00:00
better deeply reactive mutable derived
This commit is contained in:
@@ -85,7 +85,10 @@
|
||||
Database: 'The database where the data is stored.'
|
||||
}
|
||||
|
||||
let tempSettings: DataTableSettingsType = $state($state.snapshot(dataTableSettings))
|
||||
let tempSettings: DataTableSettingsType = $derived.by(() => {
|
||||
let s = $state($state.snapshot(dataTableSettings))
|
||||
return s
|
||||
})
|
||||
|
||||
function removeDataTable(index: number) {
|
||||
tempSettings.dataTables.splice(index, 1)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { untrack } from 'svelte'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import type { StateStore } from './utils'
|
||||
import { type StateStore } from './utils'
|
||||
|
||||
export function withProps<Component, Props>(component: Component, props: Props) {
|
||||
const ret = $state({
|
||||
@@ -39,6 +39,9 @@ export type UsePromiseOptions = {
|
||||
clearValueOnRefresh?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `resource` from `runed` instead
|
||||
*/
|
||||
export function usePromise<T>(
|
||||
createPromise: () => Promise<T>,
|
||||
{ loadInit = true, clearValueOnRefresh = true }: UsePromiseOptions = {}
|
||||
|
||||
Reference in New Issue
Block a user