UNPKG

effect

Version:

The missing standard library for TypeScript, for writing production-grade software.

15 lines (12 loc) 276 B
/** @internal */ export type TxnId = number & { readonly TransactioId: unique symbol } /** @internal */ const txnCounter = { ref: 0 } /** @internal */ export const make = (): TxnId => { const newId = txnCounter.ref + 1 txnCounter.ref = newId return newId as TxnId }