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' ;
12import { source , set } from '../internal/client/reactivity/sources.js' ;
23import { get } from '../internal/client/runtime.js' ;
34
@@ -99,4 +100,8 @@ export class ReactiveDate extends Date {
99100 super ( ...values ) ;
100101 this . #init( ) ;
101102 }
103+
104+ [ STATE_SNAPSHOT_SYMBOL ] ( ) {
105+ return new Date ( get ( this . #raw_time) ) ;
106+ }
102107}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { DEV } from 'esm-env';
22import { source , set } from '../internal/client/reactivity/sources.js' ;
33import { get } from '../internal/client/runtime.js' ;
44import { map } from './utils.js' ;
5+ import { STATE_SNAPSHOT_SYMBOL } from '../internal/client/constants.js' ;
6+ import { snapshot } from '../internal/client/reactivity/snapshot.js' ;
57
68var read_methods = [ 'forEach' , 'isDisjointFrom' , 'isSubsetOf' , 'isSupersetOf' ] ;
79var set_like_methods = [ 'difference' , 'intersection' , 'symmetricDifference' , 'union' ] ;
@@ -149,4 +151,9 @@ export class ReactiveSet extends Set {
149151 get size ( ) {
150152 return get ( this . #size) ;
151153 }
154+
155+ /** @param {boolean } deep */
156+ [ STATE_SNAPSHOT_SYMBOL ] ( deep ) {
157+ return new Set ( map ( this . keys ( ) , ( key ) => snapshot ( key , deep ) , 'Set Iterator' ) ) ;
158+ }
152159}
Original file line number Diff line number Diff line change 1+ import { STATE_SNAPSHOT_SYMBOL } from '../internal/client/constants.js' ;
12import { source , set } from '../internal/client/reactivity/sources.js' ;
23import { get } from '../internal/client/runtime.js' ;
34
@@ -150,6 +151,10 @@ export class ReactiveURL extends URL {
150151 toJSON ( ) {
151152 return this . href ;
152153 }
154+
155+ [ STATE_SNAPSHOT_SYMBOL ] ( ) {
156+ return new URL ( this . href ) ;
157+ }
153158}
154159
155160export class ReactiveURLSearchParams extends URLSearchParams {
You can’t perform that action at this time.
0 commit comments