Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FluxCapacitor<EventTypes>

Type parameters

  • EventTypes: string | symbol

Hierarchy

Index

Constructors

constructor

Properties

__config

__config: Configuration

_barriers

_barriers: Barriers

_lookups

_lookups: Lookups

actions

actions: ActionCreators = ActionCreators

actions for modifying contents of the store

clients

clients: Clients = FluxCapacitor.createClients(this)

instances of all microservice clients

history

history: History = <any>{}

History-related helper methods; injected at service initialization time.

selectors

selectors: Selectors = Selectors

selector functions for extracting data from the store

store

store: ReduxStore<State> = Store.create(this, Observer.listener(this))

instance of the state store

Static prefixed

prefixed: string | boolean

Accessors

config

Methods

addListener

  • addListener(event: EventTypes, fn: ListenerFn, context?: any): this
  • Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

all

  • all(events: string[], callback: function, context?: any): this
  • Listen on a collection of events.

    Callbacks registered for a given collection will be invoked each time the member events have been emitted at least once. Note that the order of the member events is not significant.

    Callbacks are not invoked with arguments, however, data may be accessed from the store as normal.

    Parameters

    • events: string[]
    • callback: function
        • (): void
        • Returns void

    • Default value context: any = this

      The context to invoke the listener with.

    Returns this

allOff

  • allOff(events: string[], callback: function): this
  • Remove a callback for a given collection of events.

    The order of the member events is not significant.

    Parameters

    • events: string[]
    • callback: function
        • (): void
        • Returns void

    Returns this

autocomplete

  • autocomplete(query: string): void

countRecords

  • countRecords(collection: string): void

detailsWithRouting

  • detailsWithRouting(product: Product | Record): void

displaySaytPastPurchases

  • displaySaytPastPurchases(): void

emit

  • emit(event: string, ...args: any[]): boolean
  • Emit an event and an associated payload.

    Update the event collection counters and invoke the associated callbacks if required.

    Parameters

    • event: string
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<EventTypes>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<EventTypes>

generateKey

  • generateKey(events: string[]): string

initHistory

  • initHistory(__namedParameters: object): void
  • Parameters

    • __namedParameters: object
      • build: function
          • (type: string, state: State): string
          • Parameters

            • type: string
            • state: State

            Returns string

      • initialUrl: string
      • parse: function
      • pushState: function
          • (data: any, title: string, url: string): void
          • Parameters

            • data: any
            • title: string
            • url: string

            Returns void

      • replaceState: function
          • (data: any, title: string, url: string): void
          • Parameters

            • data: any
            • title: string
            • url: string

            Returns void

    Returns void

listenerCount

  • listenerCount(event: EventTypes): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: EventTypes

    Returns number

listeners

  • listeners(event: EventTypes): Array<ListenerFn>
  • Return the listeners registered for a given event.

    Parameters

    • event: EventTypes

    Returns Array<ListenerFn>

moreProducts

  • moreProducts(amount: number): void

moreRefinements

  • moreRefinements(navigationName: string): void

off

  • off(event: EventTypes, fn?: ListenerFn, context?: any, once?: boolean): this
  • Parameters

    • event: EventTypes
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns this

on

  • on(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

once

  • once(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

pastPurchaseProducts

  • pastPurchaseProducts(): void

products

  • products(): void

pushState

refine

  • refine(navigationName: string, index: number): void

refreshState

  • refreshState(state: any): void

removeAllListeners

  • removeAllListeners(event?: EventTypes): this
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: EventTypes

    Returns this

removeListener

  • removeListener(event: EventTypes, fn?: ListenerFn, context?: any, once?: boolean): this
  • Remove the listeners of a given event.

    Parameters

    • event: EventTypes
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns this

replaceState

  • replaceState(route: string, buildAndParse?: boolean): void

reset

  • reset(query?: string, refinement?: object): void

resize

  • resize(pageSize: number): void

saveState

  • saveState(route: string): void

saytPastPurchases

  • saytPastPurchases(query: string): void

saytProducts

  • saytProducts(query: string, refinements?: Refinement[]): void

saytSuggestions

  • saytSuggestions(query: string): void

search

  • search(query?: string): void

sort

  • sort(index: number): void

switchCollection

  • switchCollection(collection: string): void

switchPage

  • switchPage(page: number): void

unrefine

  • unrefine(navigationName: string, index: number): void

updateHistory

  • updateHistory(__namedParameters: object): void

Static createBridge

  • createBridge(config: Configuration, errorHandler: function): BrowserBridge

Static createClients

Static createSayt

Generated using TypeDoc