Skip to content

Commit

Permalink
tweak types
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed May 26, 2019
1 parent 833e0a3 commit 9aa533d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/signals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export function isListening() {

// context API

interface Context { id: symbol, initFn: Function };
export interface Context { id: symbol, initFn?: Function };

export function createContext(initFn: any) {
export function createContext(initFn?: Function): Context {
const id = Symbol('context');
return { id, initFn };
}
Expand Down
2 changes: 1 addition & 1 deletion src/suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const SuspenseContext = createContext(() => {
// used in the runtime to seed the Suspend control flow
export function registerSuspense(fn: (o: { suspended: () => any, initializing: boolean }) => void) {
createEffect(() => {
const c = SuspenseContext.initFn();
const c = (SuspenseContext.initFn as Function)();
setContext(SuspenseContext.id, c);
fn(c);
c.initializing = false;
Expand Down

0 comments on commit 9aa533d

Please sign in to comment.