File tree 3 files changed +9
-24
lines changed
3 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -2606,7 +2606,6 @@ export function spread_props(props) {
2606
2606
* events?: Events;
2607
2607
* context?: Map<any, any>;
2608
2608
* intro?: boolean;
2609
- * immutable?: boolean;
2610
2609
* recover?: false;
2611
2610
* }} options
2612
2611
* @returns {Exports & { $destroy: () => void; $set: (props: Partial<Props>) => void; } }
@@ -2624,15 +2623,8 @@ export function createRoot(component, options) {
2624
2623
* @param {any } value
2625
2624
*/
2626
2625
function add_prop ( name , value ) {
2627
- const prop = source (
2628
- value ,
2629
- options . immutable
2630
- ? /**
2631
- * @param {any } a
2632
- * @param {any } b
2633
- */ ( a , b ) => a === b
2634
- : safe_equal
2635
- ) ;
2626
+ const prop = source ( value ) ;
2627
+ prop . e = safe_equal ; // TODO should this be default_equal?
2636
2628
_sources [ name ] = prop ;
2637
2629
define_property ( _props , name , {
2638
2630
get ( ) {
@@ -2666,11 +2658,10 @@ export function createRoot(component, options) {
2666
2658
return _props [ property ] ;
2667
2659
}
2668
2660
} ) ;
2669
- const props_source = source (
2670
- props_proxy ,
2671
- // We're resetting the same proxy instance for updates, therefore bypass equality checks
2672
- ( ) => false
2673
- ) ;
2661
+ const props_source = source ( props_proxy ) ;
2662
+
2663
+ // We're resetting the same proxy instance for updates, therefore bypass equality checks
2664
+ props_source . e = safe_equal ;
2674
2665
2675
2666
let [ accessors , $destroy ] = mount ( component , {
2676
2667
...options ,
Original file line number Diff line number Diff line change @@ -1142,25 +1142,20 @@ export function derived(init) {
1142
1142
/**
1143
1143
* @template V
1144
1144
* @param {V } initial_value
1145
- * @param {import('./types.js').EqualsFunctions<V> } [equals]
1146
1145
* @returns {import('./types.js').SourceSignal<V> }
1147
1146
*/
1148
1147
/*#__NO_SIDE_EFFECTS__*/
1149
- export function source ( initial_value , equals ) {
1148
+ export function source ( initial_value ) {
1150
1149
const source = create_source_signal ( SOURCE | CLEAN , initial_value ) ;
1151
1150
source . x = current_component_context ;
1152
- source . e = get_equals_method ( equals ) ;
1151
+ source . e = get_equals_method ( ) ;
1153
1152
return source ;
1154
1153
}
1155
1154
1156
1155
/**
1157
- * @param {import('./types.js').EqualsFunctions } [equals]
1158
1156
* @returns {import('./types.js').EqualsFunctions }
1159
1157
*/
1160
- function get_equals_method ( equals ) {
1161
- if ( equals !== undefined ) {
1162
- return equals ;
1163
- }
1158
+ function get_equals_method ( ) {
1164
1159
const context = current_component_context ;
1165
1160
if ( context && ! context . i ) {
1166
1161
return safe_equal ;
Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ class Svelte4Component {
68
68
target : options . target ,
69
69
props : { ...options . props , $$events : this . #events } ,
70
70
context : options . context ,
71
- immutable : options . immutable ,
72
71
intro : options . intro ,
73
72
recover : options . recover
74
73
} ) ;
You can’t perform that action at this time.
0 commit comments