Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

TransactionAPI

TransactionAPI: object

The Transaction API type.

Type declaration

TransactionFunction

TransactionFunction: function

The transaction body function type.

Type declaration

Functions

transaction

  • Performs transaction.

    import { transaction, collection } from 'typesaurus'
    
    type Counter = { count: number }
    const counters = collection<Counter>('counters')
    
    transaction(async ({ get, set, update, remove }) => {
      const { data: { count } } = await get('420')
      await set(counter, { count: count + 1 })
    })

    Parameters

    • transactionFn: TransactionFunction

      The transaction body function that accepts transaction API

    Returns Promise<any>

    Promise that is resolved when transaction is closed

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc