Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Interfaces

Type aliases

Functions

Type aliases

BatchCommand

BatchCommand: function

Type declaration

Functions

batch

  • Creates batch API with a set of functions (set, upset, update, remove) that are similar to regular set, update and remove with the only difference that the batch counterparts do not return a promise and perform operations only when commit function is called.

    import { batch, collection } from 'typesaurus'
    
    type Counter = { count: number }
    const counters = collection<Counter>('counters')
    
    const { set, update, remove, commit } = batch()
    
    for (let count = 0; count < 500; count++) {
      // Each batch can be up to 500 set, update and remove operations
      set(counters, count.toString(), { count })
    }
    
    // Set 500 documents
    commit().then(() => console.log('Done!'))

    Returns Batch

    The batch API object.

lazy

  • lazy<Type>(fn: function): function
  • Type parameters

    • Type

    Parameters

    • fn: function
        • (): Promise<Type>
        • Returns Promise<Type>

    Returns function

      • (): Promise<Type>
      • Returns Promise<Type>

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