Options
All
  • Public
  • Public/Protected
  • All
Menu
deprecated

will be removed in v3.0 - Use "Resource" instead

Hierarchy

  • RootJsonApiState
    • JsonApiState

Index

Properties

Protected _response

_response: JsonApiResponse

Holds a reference to the response object

Protected _state

_state: PlainObject<any>

The registered translations on this instance

Accessors

jsonElementType

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

    Returns JsonApiElementType

response

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

    Returns JsonApiResponse

Methods

destroy

  • destroy(): void
  • Destroys the internal state object

    Returns void

get

  • get(key: string | string[], fallback?: any): any
  • Returns the value of the initial state

    Parameters

    • key: string | string[]
    • Optional fallback: any

    Returns any

getAll

  • getAll(): PlainObject<any>
  • Returns all key and value pairs that are currently inside the state

    Returns PlainObject<any>

has

  • has(key: string | string[]): boolean
  • Returns true if a certain key exists in the state

    Parameters

    • key: string | string[]

    Returns boolean

hasValue

  • hasValue(key: string | string[], includeZero?: boolean): boolean
  • Similar to "has" but also checks if the value on a key is "empty". If the value is considered empty this method will return false Empty values are: NULL, undefined, 0, "", " ", {}, [] and empty Maps and Sets

    Parameters

    • key: string | string[]
    • Optional includeZero: boolean

      By default zero (0) is not seen as "empty" if you set this to true, it will be, tho

    Returns boolean

Generated using TypeDoc