A utility function that resolves the value of a toast message. The value can either be a static value or a function that generates the value based on the provided argument.

// Resolving a static value
const message = resolveToastValue('Hello, World!', toast);
// Resolving a value from a function
const message = resolveToastValue((ctx) => `Hello, ${ctx.userName}!`, toast);