Hierarchy

  • Nymph

Constructors

Properties

Entity: typeof Entity

The entity class for this instance of Nymph.

cache: default = ...
entityClasses: {
    [k: string]: EntityConstructor;
} = {}

A simple map of names to Entity classes.

Type declaration

pubsub: undefined | PubSub = undefined

And optional PubSub client instance.

requestCallbacks: RequestCallback[] = []
responseCallbacks: ResponseCallback[] = []
restUrl: string = ''
weakCache: boolean = false

Methods

  • Add your class to this instance.

    This will create a class that extends your class within this instance of Nymph and return it. You can then use this class's constructor and methods, which will use this instance of Nymph.

    Because this creates a subclass, don't use the class returned from getEntityClass to check with instanceof.

    Type Parameters

    Parameters

    • entityClass: T

    Returns T

  • Type Parameters

    Parameters

    • entity: T
    • method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
    • data: {
          [k: string]: any;
      }
      • [k: string]: any
    • plural: false

    Returns Promise<T>

  • Type Parameters

    Parameters

    • entity: T[]
    • method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
    • data: {
          [k: string]: any;
      }
      • [k: string]: any
    • plural: true

    Returns Promise<T[]>

  • Parameters

    • className: string
    • method: string
    • params: any[]

    Returns Promise<any>

Generated using TypeDoc