@promistream/no-value
v1.0.0
Published
Shared symbol for indicating within a stream that there is no value
Downloads
7
Readme
@promistream/no-value
This module exports a symbol for representing a "no value" situation; it is used by various Promistream modules for cases where a callback provided to a stream may not always produce a value.
Importantly, this symbol is not a part of the Promistreams specification; it is a convenience for stream modules that allow specifying a custom callback (eg. map
) and that need some way to represent an absence of a value, where a null
or undefined
would be too ambiguous (eg. because it would be a valid value). You should only use this symbol when a stream tells you that it supports it.
Why this is a stand-alone package
This ensures that there is only ever one symbol in use for this purpose, regardless of how many different stream modules you are using, and at what versions. This package will likely never receive an update, and it internally has a mechanism to ensure that only one global symbol is ever used across the application; if you somehow have multiple versions of this package loaded, all of them will export an identical symbol.