Helpful
    Preparing search index...

    Class ZDataSourceStatic<T>

    Represents an in memory data source.

    This is very useful for testing and when you need to cache a data set that you already have.

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Methods

    • Inserts an item into the existing data array.

      Parameters

      • item: T

        The item to insert.

      • index: number = Infinity

        The index to insert at. If this is equal to or less than 0 Then the item will be inserted at the front of the data list. If this is greater than or equal to the maximum number of items in the current list, then the item will be inserted at the end of the list.

      Returns Promise<ZDataSourceStatic<T>>

      A new data source where the item list has been updated to include the new item.

    • Gets a copy of the current list of items.

      This is equivalent to invoking retrieve with the default data request.

      Returns Promise<T[]>

      A shallow copy of the current item list. Returns a rejected promise if the initial data is an error.