This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Fast compare of two items (values or references) for nested equivalency. | |
Does NOT use stringify and is robust to key sequence. | |
Fast fails on first difference found. | |
Equivalence means that at root and at each key or index they are equivalent | |
as follows: | |
- If a value type, values are either hard equal (===) or are both NaN | |
(different than JS where NaN !== NaN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { get, writable, type Updater, type Writable, type Subscriber, | |
type Unsubscriber, type Invalidator } from "svelte/store"; | |
/** A handle returned from a call to {@link PausableWritable.pause} */ | |
export type PauseHandle = {}; | |
/** | |
A {@link Writable} that supports pausing and resuming store subscription | |
updates, enabling throttling of high-volume subscription notifications if | |
a large number of individual changes are to occur together and intermiediary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Compares two items (values or references) for nested equivalency, meaning that | |
at root and at each key or index they are equivalent as follows: | |
- If a value type, values are either hard equal (===) or are both NaN | |
(different than JS where NaN !== NaN) | |
- If functions, they are the same function instance or have the same value | |
when converted to string via `toString()` | |
- If Date objects, both have the same getTime() or are both NaN (invalid) | |
- If arrays, both are same length, and all contained values areEquivalent |