File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
packages/svelte/src/reactivity Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { STATE_SNAPSHOT_SYMBOL } from '../internal/client/constants.js' ;
1
2
import { source , set } from '../internal/client/reactivity/sources.js' ;
2
3
import { get } from '../internal/client/runtime.js' ;
3
4
@@ -99,4 +100,8 @@ export class ReactiveDate extends Date {
99
100
super ( ...values ) ;
100
101
this . #init( ) ;
101
102
}
103
+
104
+ [ STATE_SNAPSHOT_SYMBOL ] ( ) {
105
+ return new Date ( get ( this . #raw_time) ) ;
106
+ }
102
107
}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { DEV } from 'esm-env';
2
2
import { source , set } from '../internal/client/reactivity/sources.js' ;
3
3
import { get } from '../internal/client/runtime.js' ;
4
4
import { map } from './utils.js' ;
5
+ import { STATE_SNAPSHOT_SYMBOL } from '../internal/client/constants.js' ;
6
+ import { snapshot } from '../internal/client/reactivity/snapshot.js' ;
5
7
6
8
var read_methods = [ 'forEach' , 'isDisjointFrom' , 'isSubsetOf' , 'isSupersetOf' ] ;
7
9
var set_like_methods = [ 'difference' , 'intersection' , 'symmetricDifference' , 'union' ] ;
@@ -149,4 +151,9 @@ export class ReactiveSet extends Set {
149
151
get size ( ) {
150
152
return get ( this . #size) ;
151
153
}
154
+
155
+ /** @param {boolean } deep */
156
+ [ STATE_SNAPSHOT_SYMBOL ] ( deep ) {
157
+ return new Set ( map ( this . keys ( ) , ( key ) => snapshot ( key , deep ) , 'Set Iterator' ) ) ;
158
+ }
152
159
}
Original file line number Diff line number Diff line change
1
+ import { STATE_SNAPSHOT_SYMBOL } from '../internal/client/constants.js' ;
1
2
import { source , set } from '../internal/client/reactivity/sources.js' ;
2
3
import { get } from '../internal/client/runtime.js' ;
3
4
@@ -150,6 +151,10 @@ export class ReactiveURL extends URL {
150
151
toJSON ( ) {
151
152
return this . href ;
152
153
}
154
+
155
+ [ STATE_SNAPSHOT_SYMBOL ] ( ) {
156
+ return new URL ( this . href ) ;
157
+ }
153
158
}
154
159
155
160
export class ReactiveURLSearchParams extends URLSearchParams {
You can’t perform that action at this time.
0 commit comments