Skip to content

Commit 9aa533d

Browse files
committed
tweak types
1 parent 833e0a3 commit 9aa533d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/signals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ export function isListening() {
131131

132132
// context API
133133

134-
interface Context { id: symbol, initFn: Function };
134+
export interface Context { id: symbol, initFn?: Function };
135135

136-
export function createContext(initFn: any) {
136+
export function createContext(initFn?: Function): Context {
137137
const id = Symbol('context');
138138
return { id, initFn };
139139
}

src/suspense.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const SuspenseContext = createContext(() => {
1919
// used in the runtime to seed the Suspend control flow
2020
export function registerSuspense(fn: (o: { suspended: () => any, initializing: boolean }) => void) {
2121
createEffect(() => {
22-
const c = SuspenseContext.initFn();
22+
const c = (SuspenseContext.initFn as Function)();
2323
setContext(SuspenseContext.id, c);
2424
fn(c);
2525
c.initializing = false;

0 commit comments

Comments
 (0)