Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _api_route

_api_route: string

API Route of the service

Protected _initialised

_initialised: boolean = false

Whether the service has initialised or not

Protected _intervals

_intervals: {}

Store for named intervals

Type declaration

  • [name: string]: number

Protected _last_total

_last_total: number = 0

Total number of items returned by the last index query

Protected _name

_name: string

Display name of the service

Protected _observers

_observers: {}

Map of observables for state variables

Type declaration

  • [key: string]: Observable<any>

Protected _promises

_promises: {}

Map of promises for Service

Type declaration

  • [key: string]: Promise<any>

Protected _subjects

_subjects: {}

Map of state variables for Service

Type declaration

  • [key: string]: BehaviorSubject<any> | Subject<any>

Protected _subscribers

_subscribers: {}

Map of poll subscribers for API endpoints

Type declaration

  • [key: string]: Subscriber<any>

Protected _subscriptions

_subscriptions: {}

Store for named subscription unsub callbacks

Type declaration

  • [name: string]: Subscription | (() => void)

Protected _timers

_timers: {}

Store for named timers

Type declaration

  • [name: string]: number

Protected _total

_total: number = 0

Total number of items returned by the last basic index query

Protected http

Accessors

api_route

  • get api_route(): string

initialised

  • get initialised(): boolean

last_total

  • get last_total(): number

total

  • get total(): number

Methods

add

Protected clearInterval

  • clearInterval(name: string): void

Protected clearTimeout

  • clearTimeout(name: string): void

delete

  • delete(id: string, query_params?: HashMap): Promise<void>

destroy

  • destroy(): void

Protected interval

  • interval(name: string, fn: () => void, delay?: number): void
  • Creates a named interval

    Parameters

    • name: string

      Name of the interval

    • fn: () => void

      Callback function for the interval

        • (): void
        • Returns void

    • Default value delay: number = 300

      Callback delay

    Returns void

poll

  • poll(id?: undefined | string, query_params?: HashMap, delay?: number): Observable<T | T[]>
  • Setup a poller for an index or show API endpoint

    Parameters

    • Optional id: undefined | string

      Show request ID. Leave blank to poll on the query endpoint

    • Default value query_params: HashMap = {}

      Map of query paramaters to add to the polled URL

    • Default value delay: number = 5000

      Delay between each poll event. Defaults to 5000 ms

    Returns Observable<T | T[]>

Protected process

query

  • query(query_params?: HashMap): Promise<T[]>

show

  • show(id: string, query_params?: HashMap): Promise<T>

stopPoll

  • stopPoll(id?: undefined | string, query_params?: HashMap): void

Protected subscription

  • subscription(name: string, unsub: Subscription | (() => void)): void

task

  • task<U>(id: string, task_name: string, form_data?: HashMap, method?: "post" | "get"): Promise<U>
  • Perform API task for the given item ID

    Type parameters

    • U

    Parameters

    • id: string

      ID of the item

    • task_name: string

      Name of the task

    • Default value form_data: HashMap = {}

      Map of data to pass to the API

    • Default value method: "post" | "get" = "post"

      Verb to use for request

    Returns Promise<U>

Protected timeout

  • timeout(name: string, fn: () => void, delay?: number): void
  • Creates a named timer

    Parameters

    • name: string

      Name of the timer

    • fn: () => void

      Callback function for the timer

        • (): void
        • Returns void

    • Default value delay: number = 300

      Callback delay

    Returns void

Protected unsub

  • unsub(name: string): void

update

  • update(id: string, form_data: HashMap, query_params?: HashMap, type?: "put" | "patch"): Promise<T>
  • Make put request for changes to the item with the given id

    Parameters

    • id: string

      ID of the item being updated

    • form_data: HashMap

      New values for the item

    • Default value query_params: HashMap = {}

      Map of query paramaters to add to the request URL

    • Default value type: "put" | "patch" = "patch"

    Returns Promise<T>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc