Constructors

Properties

cache: EntityWeakCache = ...

The entity cache.

Entity: typeof Entity

The entity class for this instance of Nymph.

headers: {
    [k: string]: string;
} = {}

Headers that will be sent with every request.

These are used by Tilmeld for authentication.

pubsub: undefined | PubSub = undefined

And optional PubSub client instance.

returnNullOnNotFound: boolean = false

Return null or empty array instead of error when entity/ies not found.

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. Instead, use the base class that you passed into this method.

    Type Parameters

    Parameters

    • entityClass: T

    Returns T

  • Parameters

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

    Returns Promise<any>