@@ -6,7 +6,7 @@ import type { JSX } from "../jsx";
66
77export const equalFn = < T > ( a : T , b : T ) => a === b ;
88export const $PROXY = Symbol ( "solid-proxy" ) ;
9- export const $DEVCOMP = Symbol ( ' solid-dev-component' ) ;
9+ export const $DEVCOMP = Symbol ( " solid-dev-component" ) ;
1010const signalOptions = { equals : equalFn } ;
1111let ERROR : symbol | null = null ;
1212let runEffects = runQueue ;
@@ -324,17 +324,23 @@ export function createEffect<Next, Init = Next>(
324324 */
325325export function createReaction ( onInvalidate : ( ) => void , options ?: EffectOptions ) {
326326 let fn : ( ( ) => void ) | undefined ;
327- const c = createComputation ( ( ) => {
328- fn ? fn ( ) : untrack ( onInvalidate ) ;
329- fn = undefined ;
330- } , undefined , false , 0 , "_SOLID_DEV_" ? options : undefined ) ,
327+ const c = createComputation (
328+ ( ) => {
329+ fn ? fn ( ) : untrack ( onInvalidate ) ;
330+ fn = undefined ;
331+ } ,
332+ undefined ,
333+ false ,
334+ 0 ,
335+ "_SOLID_DEV_" ? options : undefined
336+ ) ,
331337 s = SuspenseContext && lookup ( Owner , SuspenseContext . id ) ;
332338 if ( s ) c . suspense = s ;
333339 c . user = true ;
334340 return ( tracking : ( ) => void ) => {
335341 fn = tracking ;
336342 updateComputation ( c ) ;
337- }
343+ } ;
338344}
339345
340346interface Memo < Prev , Next = Prev > extends SignalState < Next > , Computation < Next > {
@@ -971,10 +977,11 @@ export function resumeEffects(e: Computation<any>[]) {
971977// Dev
972978export function devComponent < T > ( Comp : ( props : T ) => JSX . Element , props : T ) {
973979 const c : Partial < Memo < JSX . Element , JSX . Element > > = createComputation < JSX . Element , JSX . Element > (
974- ( ) => untrack ( ( ) => {
975- Object . assign ( Comp , { [ $DEVCOMP ] : true } ) ;
976- return Comp ( props ) ;
977- } ) ,
980+ ( ) =>
981+ untrack ( ( ) => {
982+ Object . assign ( Comp , { [ $DEVCOMP ] : true } ) ;
983+ return Comp ( props ) ;
984+ } ) ,
978985 undefined ,
979986 true
980987 ) ;
@@ -1564,7 +1571,10 @@ function handleError(err: any) {
15641571
15651572function lookup ( owner : Owner | null , key : symbol | string ) : any {
15661573 return (
1567- owner && ( ( owner . context && owner . context [ key ] ) || ( owner . owner && lookup ( owner . owner , key ) ) )
1574+ owner &&
1575+ ( ( owner . context && owner . context [ key ] !== undefined )
1576+ ? owner . context [ key ]
1577+ : owner . owner && lookup ( owner . owner , key ) )
15681578 ) ;
15691579}
15701580
0 commit comments