Attempts to align prior data with new data, based on a provided similarity function.
Returns a function that attempts to align a series of data by its id. See also align for a version with no internal storage.
Compares the values of two iterables, returning a list
of items they have in common and those unique in a
or b
.
Ignores ordering of values, and is NOT recursive.
Inverts the source comparer.
Returns a Continuously that continually executes callback
at interval
rate.
Compares numbers by numeric value, otherwise uses the default logic of string comparison.
If values are strings, uses that as the key.
Otherwise uses JSON.stringify
.
Converts a value to string form. For simple objects, .toString() is used, other JSON.stringify is used. It is meant for creating debugging output or 'hash' versions of objects, and does not necessarily maintain full fidelity of the input
Returns a function that reports an 'infinite' elapsed time.
this can be useful as an initialiser for elapsedSince
et al.
Returns the interval between the start and each subsequent call.
Returns elapsed time since initial call, however unlike elapsedSince, timer stops when first invoked.
Returns elapsed time since the initial call.
Returns a human-readable representation of some elapsed milliseconds
Returns v
if predicate
returns true,
alternatively returning skipValue
.
Returns true if rx
has a last value
Return the millisecond value of an Interval.
Returns true if Object.entries() is empty for value
Default comparer function is equiv to checking a === b
.
Use isEqualValueDefault to compare by value, via comparing JSON string representation.
Wraps the eq
function, tracing the input data result
Comparer returns true if string representation of a
and b
are equal.
Use isEqualDefault to compare using === semantics
Uses toStringDefault
to generate a string representation (via JSON.stringify
).
Comparer returns true if string representation of a
and b
are equal, regardless of field ordering.
Uses toStringOrdered
to generate a string representation (via JSON.stringify`).
Returns true if a
contains the values of b
. a
may contain other values, but we
only check against what is in b
. a
and b
must both be simple objects.
Returns true if value
is an integer. Parses string input, but
all other data types return false.
Returns true if interval
matches the Interval type.
Returns true if value
is a Map type
Returns true if value
is number, string, bigint or boolean.
Returns false if value
is an object, null, undefined
Returns true if value
is number, string, bigint, boolean or an object
Returns true if rx
is a Reactive
Returns true if value
is a Set type
Default sort comparer, following same sematics as Array.sort. Consider using defaultComparer to get more logical sorting of numbers.
Sort numbers in ascending order.
Resolves r
to a value, where r
is:
Returns a copy of object
, with the same properties. For each property
that has a basic value (string, number, boolean, object), the value is set
for the return object. If the property is a function or generator, its value
is used instead. Async functions and generators are also usable.
'Resolves' all the fields of object
in a synchronous manner.
Uses resolveSync under-the-hood
For a given input r
, attempts to 'resolve' it. See resolve for details.
Resolves a value as per resolve, however
If an error is thrown or the resolution results in undefined
or NaN, fallbackValue
is returned instead.
Returns true if it seems like the code is running on iOS (iPad/iPhone)
Returns after timeout period.
Delays until predicate
returns true.
Can be useful for synchronising with other async activities.
A default converter to string that uses JSON.stringify if its an object, or the thing itself if it's a string
If input is a string, it is returned. Otherwise, it returns the result of JSON.stringify() with fields ordered.
Tracks unique values. Returns true if value is unique. Alternatively: uniqueInstances
Tracks unique object instances. Returns true if value is unique. Alternatively: unique to track by value.
Options for alignmnent
Array items
Functions which modify an array
Kind of change
Change record
Result of compareObjectData
Runs a function continuously, returned by continuously
Options for continuously
Some data with an id property.
A fixed-length array
Interval types allows for more expressive coding, rather than embedding millisecond values.
Function that returns true if a
and b
are considered equal
Return true if a
and b
ought to be considered equal
at a given path
A message
A rank function that compares A and B. Returns the highest value, 'a' or 'b'. Returns 'eq' if values are equal
A Reactive
A reactive with an initial value
A reactive that does not have an initial value
A type where every property is partial (recursive)
Remaps TShape
so each field has type TFieldValue
.
Recursive.
Removes readonly from all properties (recursive)
Makes a type such that only one of the provided properties is required. RequireOnlyOne<someType, 'prop1'|'prop2'>
An object that can be 'resolved'.
Something that can resolve to a value
Signals
Returns the similarity of a
and b
to each other,
where higher similarity should be a higher number.
Unsubscribes from a reactive
Removes readonly from all properties (non-recursive)
Returns true if a
and b
are equal based on their JSON representations.
path
is ignored.
Functions for working with map data structures