Skip to content

Commit

Permalink
tweak create_context type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Sep 22, 2024
1 parent a169af5 commit 56462f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/context_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import {getContext, setContext} from 'svelte';
* `get` throws an error if no value is set in the context.
*/
export function create_context<T>(options: {fallback: () => T}): {
get: (error_message?: string) => T;
get: () => T;
set: (value?: T) => T;
};
export function create_context<T>(options: {optional: true}): {
get: (error_message?: string) => T | undefined;
get: () => T | undefined;
set: (value: T) => T;
};
export function create_context<T>(options?: {optional?: false}): {
Expand Down

0 comments on commit 56462f9

Please sign in to comment.