Releases: eblocha/composable-locks
Releases · eblocha/composable-locks
Removal of 'Domain'
With v0.5.0, the old Domain
class is removed in favor of Symbol
for domain identifiers in the re-entrant mutex.
Symbols have the benefit of being allowed in plain objects. Symbols also have additional convenience methods built-in.
This change also reduces the bundle size ever so slightly since it is missing the Domain
class definition.
Typing Updates to Keyed Mutex
- Simplified key resolver function type signature, generic can be any type.
- By default, the KeyedMutex will accept
string | number | symbol
keys, instead of defaulting to string. This can automatically be narrowed by providing a type-annotated resolver function.
Remove LockType enum from RWMutex
- Removed the
LockType
enum from the RWMutex - typescript enums cause issues with tree-shaking
- Moved to string union type, and renamed to
RWLockType
- Package can now be marked side-effect free