Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActionBuilder<C, K, X, A>

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _children

_children: X = {} as X

Protected _context

_context: Context<C> = new Context()

used to track transformations to the context

Protected Optional _ctor

_ctor: ActionConstructor<K, A, any>

Protected _parents

_parents: Array<ConfigBuilder<any, string>>

Protected _request

_request: RequestContext = new RequestContext()

used to track transformations to the request

Optional name

name: K

Methods

body

build

Private buildBody

  • buildBody(handler: function): any

Protected buildChildren

  • buildChildren(fetch: fetch, mixin?: this): Record<keyof X, any>
  • build the child clients of this builder

    Parameters

    • fetch: fetch

      an override for the fetch instance used by the resulting client

    • Optional mixin: this

      a builder to inherit from before building the child clients

    Returns Record<keyof X, any>

ctor

ctx

  • ctx(obj: Partial<C>): this
  • merge an object with the context of this builder using the same logic as Object.assign

    Parameters

    • obj: Partial<C>

      an object to merge with the current context

    Returns this

delete

  • delete(): this

Protected evolve

  • evolve(builder: this): this

extend

  • extend(name: string): this

flatten

formatter

get

  • get(): this

headers

inherit

Protected mergeContexts

method

  • method(method: Method): this

nest

Protected newInstance

parser

patch

  • patch(): this

path

pipe

port

post

  • post(): this

put

  • put(): this

query

Protected replaceParent

  • replaceParent(prev: this, next: this): this

Protected resolveContext

  • resolveContext(initialValue?: object): C
  • construct a context object by applying a series of transformations to an initialValue

    Parameters

    • Default value initialValue: object = {}

      a starting value to use for the context transformations

    Returns C

Protected resolveRequest

  • resolveRequest(context: any, initialValue?: object): Request
  • construct a request object by applying a series of transformations to an initialValue

    Parameters

    • context: any

      a context object used to resolve request transformations

    • Default value initialValue: object = {}

      the starting value to use for the request transformations

    Returns Request

Private send

  • build the final request, send it and apply appropriate middleware

    Parameters

    • fetch: fetch

      an override for the fetch instance used by the resulting client

    • Default value builder: ActionBuilder<C, string, X, A> = this

      a builder to use to construct the final context and request objects

    Returns Promise<Response>

url

use

Protected wrappedConstructor

  • wrappedConstructor(self?: this): function
  • wrap the constructor with context update handlers

    Parameters

    • Default value self: this = this

      an override for the builder to accept new transformations

    Returns function

      • (...args: A): void
      • Parameters

        • Rest ...args: A

        Returns void

Private wrappedRequestBuilder

  • wrappedRequestBuilder(handlerOrValue: function | object): Promise<Response>
  • a callback for accepting a request builder callback or value and sending the resulting request

    Parameters

    • handlerOrValue: function | object

    Returns Promise<Response>

Static Private sendRequest

  • sendRequest(fetch: fetch, __namedParameters: object): Promise<Response>

Generated using TypeDoc