Home Identifier Source Repository

Typedef

Static Public Summary
public

A generic action object that is dispatched by {APIDispatcher}

public

An action object that is dispatched when counts should be added to a store

public

An action object the is dispatched when an object is destroyed

public

A method signature for rejected request promises

public

An action object that is dispatched when items should be added to a store

public

A Promise that resolves with a SuccessfulRequestCallback and rejects with a FailedRequestCallback

public

An object representing a resource query.

public

A method signature for resolved request promises

Static Public

public Action: object source

A generic action object that is dispatched by {APIDispatcher}

Properties:

NameTypeAttributeDescription
actionType string

The type of action being dispatched

public CountAction: object source

An action object that is dispatched when counts should be added to a store

Properties:

NameTypeAttributeDescription
actionType string

The type of action being dispatched

count number

The count returned from the API call

query ResourceQuery
  • optional

The query params for the count call

public DestroyAction: object source

An action object the is dispatched when an object is destroyed

Properties:

NameTypeAttributeDescription
actionType string

The type of action being dispatched

id number | string

The id of the destroyed resource

public FailedRequestCallback(error: Error): Function source

A method signature for rejected request promises

Example:

import WebAPI from "./WebAPI";

WebAPI.get("/failed/request").catch(error => {
  // do something with the error
  console.log(error.message);
});

public MergeAction: object source

An action object that is dispatched when items should be added to a store

Properties:

NameTypeAttributeDescription
actionType string

The type of action being dispatched

items Array<object>

An array of items to be added to the store

public RequestPromise: Promise source

A Promise that resolves with a SuccessfulRequestCallback and rejects with a FailedRequestCallback

public ResourceQuery: number | string | object source

An object representing a resource query.

Can be one of the following:

  • number - Assumes the value is a resource id
  • string - Assumes the value is a resource id
  • object - Will be converted to a query string

public SuccessfulRequestCallback(json: object): Function source

A method signature for resolved request promises

Example:

import WebAPI from "./WebAPI";

WebAPI.get("/some/path").then(json => {
  // do something with the result
  console.log(json);
});