PinnedVersion
ref / conversations / PinnedVersion
A container for two functions that are pinned to a specific version. The two functions can be used to add the bound version to data, and to unpack the data again. This container is typically created using pin
Methods
versionify
ts
versionify<S>(state: S): VersionedState<S>;
Adds a version to some data.
unpack
ts
unpack<S>(data?: VersionedState<S>): S | undefined;
Unpacks some versioned data. Returns the original data if the data is correct, and undefined
otherwise. If undefined
is passed, then undefined
will be returned.