@@ -1046,11 +1046,8 @@ describe('vNode-diff', () => {
10461046 it ( 'should cleanup effects when wrapped signal attribute is replaced with non-signal' , ( ) => {
10471047 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
10481048 const inner = createSignal ( 'initial' ) as SignalImpl ;
1049- const wrapped1 = _fnSignal (
1050- ( ) => inner . value ,
1051- [ ] ,
1052- '() => inner.value'
1053- ) as WrappedSignalImpl < any > ;
1049+ const fn = ( ) => inner . value ;
1050+ const wrapped1 = _fnSignal ( fn , [ ] , '() => inner.value' ) as WrappedSignalImpl < any > ;
10541051 const test1 = _jsxSorted ( 'span' , { class : wrapped1 } , null , [ ] , 0 , null ) ;
10551052 const journal : VNodeJournal = [ ] ;
10561053 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1081,11 +1078,8 @@ describe('vNode-diff', () => {
10811078 it ( 'should cleanup effects when wrapped signal attribute is replaced with another wrapped signal' , ( ) => {
10821079 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
10831080 const inner1 = createSignal ( 'first' ) as SignalImpl ;
1084- const wrapped1 = _fnSignal (
1085- ( ) => inner1 . value ,
1086- [ ] ,
1087- '() => inner1.value'
1088- ) as WrappedSignalImpl < any > ;
1081+ const fn1 = ( ) => inner1 . value ;
1082+ const wrapped1 = _fnSignal ( fn1 , [ ] , '() => inner1.value' ) as WrappedSignalImpl < any > ;
10891083 const test1 = _jsxSorted ( 'span' , { class : wrapped1 } , null , [ ] , 0 , null ) ;
10901084 const journal : VNodeJournal = [ ] ;
10911085 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1102,11 +1096,8 @@ describe('vNode-diff', () => {
11021096
11031097 // Replace with another wrapped signal using a different inner signal
11041098 const inner2 = createSignal ( 'second' ) as SignalImpl ;
1105- const wrapped2 = _fnSignal (
1106- ( ) => inner2 . value ,
1107- [ ] ,
1108- '() => inner2.value'
1109- ) as WrappedSignalImpl < any > ;
1099+ const fn2 = ( ) => inner2 . value ;
1100+ const wrapped2 = _fnSignal ( fn2 , [ ] , '() => inner2.value' ) as WrappedSignalImpl < any > ;
11101101 const test2 = _jsxSorted ( 'span' , { class : wrapped2 } , null , [ ] , 0 , null ) ;
11111102 const journal2 : VNodeJournal = [ ] ;
11121103 vnode_diff ( container , journal2 , test2 , vParent , vParent , null ) ;
@@ -1128,11 +1119,8 @@ describe('vNode-diff', () => {
11281119 it ( 'should cleanup effects when wrapped signal attribute is removed' , ( ) => {
11291120 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
11301121 const inner = createSignal ( 'test' ) as SignalImpl ;
1131- const wrapped = _fnSignal (
1132- ( ) => inner . value ,
1133- [ ] ,
1134- '() => inner.value'
1135- ) as WrappedSignalImpl < any > ;
1122+ const fn = ( ) => inner . value ;
1123+ const wrapped = _fnSignal ( fn , [ ] , '() => inner.value' ) as WrappedSignalImpl < any > ;
11361124 const test1 = _jsxSorted ( 'span' , { class : wrapped } , null , [ ] , 0 , null ) ;
11371125 const journal : VNodeJournal = [ ] ;
11381126 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1164,11 +1152,8 @@ describe('vNode-diff', () => {
11641152 it ( 'should cleanup effects when store wrapped attribute is replaced with non-signal' , ( ) => {
11651153 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
11661154 const store = getOrCreateStore ( { cls : 'initial' } , StoreFlags . RECURSIVE , container ) ;
1167- const wrapped1 = _fnSignal (
1168- ( ) => store . cls ,
1169- [ ] ,
1170- '() => store.cls'
1171- ) as WrappedSignalImpl < any > ;
1155+ const fn = ( ) => store . cls ;
1156+ const wrapped1 = _fnSignal ( fn , [ ] , '() => store.cls' ) as WrappedSignalImpl < any > ;
11721157 const test1 = _jsxSorted ( 'span' , { class : wrapped1 } , null , [ ] , 0 , null ) ;
11731158 const journal : VNodeJournal = [ ] ;
11741159 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1198,11 +1183,8 @@ describe('vNode-diff', () => {
11981183 it ( 'should cleanup effects when store wrapped attribute is replaced with another store wrapped attribute' , ( ) => {
11991184 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
12001185 const store1 = getOrCreateStore ( { cls : 'first' } , StoreFlags . RECURSIVE , container ) ;
1201- const wrapped1 = _fnSignal (
1202- ( ) => store1 . cls ,
1203- [ ] ,
1204- '() => store1.cls'
1205- ) as WrappedSignalImpl < any > ;
1186+ const fn1 = ( ) => store1 . cls ;
1187+ const wrapped1 = _fnSignal ( fn1 , [ ] , '() => store1.cls' ) as WrappedSignalImpl < any > ;
12061188 const test1 = _jsxSorted ( 'span' , { class : wrapped1 } , null , [ ] , 0 , null ) ;
12071189 const journal : VNodeJournal = [ ] ;
12081190 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1217,11 +1199,8 @@ describe('vNode-diff', () => {
12171199
12181200 // Replace with another wrapped signal using a different store
12191201 const store2 = getOrCreateStore ( { cls : 'second' } , StoreFlags . RECURSIVE , container ) ;
1220- const wrapped2 = _fnSignal (
1221- ( ) => store2 . cls ,
1222- [ ] ,
1223- '() => store2.cls'
1224- ) as WrappedSignalImpl < any > ;
1202+ const fn2 = ( ) => store2 . cls ;
1203+ const wrapped2 = _fnSignal ( fn2 , [ ] , '() => store2.cls' ) as WrappedSignalImpl < any > ;
12251204 const test2 = _jsxSorted ( 'span' , { class : wrapped2 } , null , [ ] , 0 , null ) ;
12261205 const journal2 : VNodeJournal = [ ] ;
12271206 vnode_diff ( container , journal2 , test2 , vParent , vParent , null ) ;
@@ -1240,11 +1219,8 @@ describe('vNode-diff', () => {
12401219 it ( 'should cleanup effects when store wrapped attribute is removed' , ( ) => {
12411220 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'span' , { } , null , [ ] , 0 , null ) ) ;
12421221 const store = getOrCreateStore ( { cls : 'test' } , StoreFlags . RECURSIVE , container ) ;
1243- const wrapped = _fnSignal (
1244- ( ) => store . cls ,
1245- [ ] ,
1246- '() => store.cls'
1247- ) as WrappedSignalImpl < any > ;
1222+ const fn = ( ) => store . cls ;
1223+ const wrapped = _fnSignal ( fn , [ ] , '() => store.cls' ) as WrappedSignalImpl < any > ;
12481224 const test1 = _jsxSorted ( 'span' , { class : wrapped } , null , [ ] , 0 , null ) ;
12491225 const journal : VNodeJournal = [ ] ;
12501226 vnode_diff ( container , journal , test1 , vParent , vParent , null ) ;
@@ -1275,11 +1251,8 @@ describe('vNode-diff', () => {
12751251 const { vParent, container } = vnode_fromJSX ( _jsxSorted ( 'div' , { } , null , [ ] , 0 , null ) ) ;
12761252
12771253 const inner = createSignal ( 'cls' ) as SignalImpl < string > ;
1278- const wrapped = _fnSignal (
1279- ( ) => inner . value ,
1280- [ ] ,
1281- '() => inner.value'
1282- ) as WrappedSignalImpl < any > ;
1254+ const fn = ( ) => inner . value ;
1255+ const wrapped = _fnSignal ( fn , [ ] , '() => inner.value' ) as WrappedSignalImpl < any > ;
12831256
12841257 const Child = component$ ( ( props : any ) => {
12851258 return < span class = { props . cls . value } > </ span > ;
0 commit comments