Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RootCollection
    • Collection

Index

Properties

Protected _byId

_byId: PlainObject<Resource>

The list of states we are holding -> by their entity id

Protected _byOrder

_byOrder: Resource[]

The list of states we are holding -> as array by their given order

Protected _meta

_meta: State

Additional metadata that was passed by the api

Protected _pagination

_pagination: JsonApiPagination

The pagination object or null

Protected _response

_response: JsonApiResponse

Holds a reference to the response object

Accessors

jsonElementType

  • get jsonElementType(): JsonApiElementType
  • Returns the type of state

    Returns JsonApiElementType

meta

  • get meta(): State
  • Returns the meta information that was given by the api

    Returns State

pagination

  • get pagination(): JsonApiPagination
  • Returns the pagination for this api state

    Returns JsonApiPagination

response

  • get response(): JsonApiResponse
  • Returns the reference to the raw response object

    Returns JsonApiResponse

Methods

[Symbol.iterator]

  • [Symbol.iterator](): Iterator<Resource, any, undefined>
  • Returns the iterator for the collection

    Returns Iterator<Resource, any, undefined>

forEach

  • forEach(callback: CollectionForEachCallbackType): void
  • Iterates over all main entities in this state

    Parameters

    • callback: CollectionForEachCallbackType

    Returns void

get

  • get(id: string | number): Resource
  • Returns a single item of the list by the entities id

    Parameters

    • id: string | number

    Returns Resource

getAll

  • getAll(): Resource[]
  • Returns the raw state array

    Returns Resource[]

getRaw

  • getRaw(): PlainObject<any>[]
  • Returns a raw array of all contained resources converted into a plain object

    Returns PlainObject<any>[]

has

  • has(id: string | number): boolean
  • Returns true if a certain item with the given id exists in the state list

    Parameters

    • id: string | number

    Returns boolean

hasPagination

  • hasPagination(): boolean
  • Returns true if there is a pagination, false if not

    Returns boolean

Generated using TypeDoc