From 20114c8921b8934250b8e0ca39f43651caa309e9 Mon Sep 17 00:00:00 2001 From: Yiak <25087436+Yiak@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:46:41 -0500 Subject: [PATCH] fix: toast.promise() type errors with ValueOrFunction --- src/lib/core/toast.ts | 6 +++--- src/lib/core/types.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/core/toast.ts b/src/lib/core/toast.ts index a60f110..1a8b766 100644 --- a/src/lib/core/toast.ts +++ b/src/lib/core/toast.ts @@ -2,10 +2,10 @@ import { dismiss, remove, upsert } from './store'; import { type Toast, type Renderable, - type IntoRenderable, type DefaultToastOptions, type ToastOptions, type ToastType, + type ValueOrFunction, resolveValue } from './types'; import { genId } from './utils'; @@ -53,8 +53,8 @@ toast.promise = ( promise: Promise, msgs: { loading: Renderable; - success: IntoRenderable; - error: IntoRenderable; + success: ValueOrFunction; + error: ValueOrFunction; }, opts?: DefaultToastOptions ) => { diff --git a/src/lib/core/types.ts b/src/lib/core/types.ts index d23ae80..eb1c98a 100644 --- a/src/lib/core/types.ts +++ b/src/lib/core/types.ts @@ -10,7 +10,6 @@ export type ToastPosition = | 'bottom-right'; export type Renderable = typeof SvelteComponent | string | null; -export type IntoRenderable = string | null | ((value: T) => Renderable); export interface IconTheme { primary: string;