@@ -6,7 +6,7 @@ import type { JSX } from "../jsx";
6
6
7
7
export const equalFn = < T > ( a : T , b : T ) => a === b ;
8
8
export const $PROXY = Symbol ( "solid-proxy" ) ;
9
- export const $DEVCOMP = Symbol ( ' solid-dev-component' ) ;
9
+ export const $DEVCOMP = Symbol ( " solid-dev-component" ) ;
10
10
const signalOptions = { equals : equalFn } ;
11
11
let ERROR : symbol | null = null ;
12
12
let runEffects = runQueue ;
@@ -324,17 +324,23 @@ export function createEffect<Next, Init = Next>(
324
324
*/
325
325
export function createReaction ( onInvalidate : ( ) => void , options ?: EffectOptions ) {
326
326
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
+ ) ,
331
337
s = SuspenseContext && lookup ( Owner , SuspenseContext . id ) ;
332
338
if ( s ) c . suspense = s ;
333
339
c . user = true ;
334
340
return ( tracking : ( ) => void ) => {
335
341
fn = tracking ;
336
342
updateComputation ( c ) ;
337
- }
343
+ } ;
338
344
}
339
345
340
346
interface Memo < Prev , Next = Prev > extends SignalState < Next > , Computation < Next > {
@@ -971,10 +977,11 @@ export function resumeEffects(e: Computation<any>[]) {
971
977
// Dev
972
978
export function devComponent < T > ( Comp : ( props : T ) => JSX . Element , props : T ) {
973
979
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
+ } ) ,
978
985
undefined ,
979
986
true
980
987
) ;
@@ -1564,7 +1571,10 @@ function handleError(err: any) {
1564
1571
1565
1572
function lookup ( owner : Owner | null , key : symbol | string ) : any {
1566
1573
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 ) )
1568
1578
) ;
1569
1579
}
1570
1580
0 commit comments