apiref
stack-local-storage@0.2.0

stack-local-storage  EntryPoint

A StackLocalStorage can be used to thread values through synchronous call stacks.

An ExclusiveStackLocalStorage can be used to ensure that a given store is only used once at a time. When getting value, it throws an error if the store is not set. It also throws if the store is being set in a nested manner.

These tools can be helpful in eliminating repetitive variable passing when creating DSLs. See the respective classes for examples.

Classes

ClassDescription
ExclusiveStackLocalStorageLike a StackLocalStorage, but only allows one store to be set at a time.
ExclusiveStorageConflictErrorThrown when an ExclusiveStackLocalStorage is being set in a nested manner.
ExclusiveStorageEmptyErrorThrown when an ExclusiveStackLocalStorage is being read while not set.
StackLocalStorageA StackLocalStorage can be used to pass (thread) values (referred to as a “store”) through synchronous call stacks. This can be helpful in eliminating repetitive variable passing when creating DSLs.

Interfaces

InterfaceDescription
ExclusiveStackLocalStorageOptionsOptions for ExclusiveStackLocalStorage.