pull/14636/head
Rich Harris 2 weeks ago committed by GitHub
parent c6fca02009
commit 3dcd5a4a3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -23,6 +23,6 @@ The following properties cannot be cloned with `$state.snapshot` — the return
`$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable: `$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable:
```js ```js
const state = $state({ property: 'this is cloneable', window }) const object = $state({ property: 'this is cloneable', window })
const snapshot = $state.snapshot(); const snapshot = $state.snapshot(object);
``` ```

@ -15,6 +15,6 @@ Elements such as `<input>` cannot have content, any children passed to these ele
`$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable: `$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable:
```js ```js
const state = $state({ property: 'this is cloneable', window }) const object = $state({ property: 'this is cloneable', window })
const snapshot = $state.snapshot(); const snapshot = $state.snapshot(object);
``` ```

Loading…
Cancel
Save