Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Provider<S, A, S, A>

Type parameters

  • S: any

  • A: any

  • S: any

  • A: any

Hierarchy

Index

Properties

_consumes

_consumes: string[] = []

_eventHandlers

_eventHandlers: [string, function][] = []

_provides

_provides: Record<string, function>

isInitialized

isInitialized: boolean = false

props

props: Props & Props = <any>{}

state

state: S = <any>{}

Static Optional _aliases

_aliases: object

Static _riot_id

_riot_id: number

Static actions

actions: ActionCreators

Static config

Static flux

flux: FluxCapacitor

Static isMounted

isMounted: boolean

Static log

log: Log

Static opts

opts: Props

Static Optional parent

parent: TagInstance

the parent tag if any

Static refs

refs: TagRefs

References to tags or DOM elements

Static root

root: HTMLElement

Static services

services: SystemServices

Static tags

tags: NestedTags

nested custom tags

Methods

_removeEventHandlers

  • _removeEventHandlers(): void

consume

  • consume(alias: string): void

dispatch

  • dispatch(action: Action<string, any>): void

init

  • init(): void

provide

  • provide(alias: string, resolve?: function): void
  • Parameters

    • alias: string
    • Default value resolve: function = (_, state) => state
        • (props: Props, state: S, aliases: A): void
        • Parameters

          • props: Props
          • state: S
          • aliases: A

          Returns void

    Returns void

select

  • select(selector: function, ...args: any[]): any
  • Parameters

    • selector: function
        • (state: State, ...args: any[]): any
        • Parameters

          • state: State
          • Rest ...args: any[]

          Returns any

    • Rest ...args: any[]

    Returns any

set

  • set(state: Partial<S> | true): void

subscribe

  • subscribe<T>(event: string, handler: function): void
  • Type parameters

    • T

    Parameters

    • event: string
    • handler: function
        • (data?: T): void
        • Parameters

          • Optional data: T

          Returns void

    Returns void

subscribeOnce

  • subscribeOnce(event: string, handler: function): void
  • Parameters

    • event: string
    • handler: function
        • (event: string, data?: any): void
        • Parameters

          • event: string
          • Optional data: any

          Returns void

    Returns void

Static expose

  • expose(alias: string, value?: any): void

Static init

  • init(): void

Static mixin

  • mixin(mixin: string | TagMixin): void
  • Extend tag with functionality available on shared mixin registered with riot.mixin(mixinName, mixinObject) or extend tag functionality with functionality available on provided mixin object.

    Parameters

    • mixin: string | TagMixin

      Name of shared mixin or mixin object

    Returns void

Static mount

  • mount(): void
  • Mount the tag

    Returns void

Static off

  • off(event: string, callback?: ObservableCallback): this
  • For specified event remove specified callback or all registered callbacks if callback is not passed in

    Parameters

    • event: string

      Event name or wildcard '*' that matches all events

    • Optional callback: ObservableCallback

      Callback function to remove

    Returns this

Static on

  • on(event: string, callback: ObservableCallback): this
  • Register callback for specified events. Callback is executed each time event is triggered

    Parameters

    • event: string

      Event name or wildcard '*' that matches all events

    • callback: ObservableCallback

      Callback function

    Returns this

Static onBeforeMount

  • onBeforeMount(): void

Static onBeforeUnmount

  • onBeforeUnmount(): void

Static onMount

  • onMount(): void

Static onUnmount

  • onUnmount(): void

Static onUpdate

  • onUpdate(stateChange?: object): void

Static onUpdated

  • onUpdated(): void

Static one

  • one(event: string, callback: ObservableCallback): this
  • Register callback for specified events. Callback is executed at most once.

    Parameters

    • event: string

      Event name.

    • callback: ObservableCallback

      Callback function

    Returns this

Static shouldUpdate

  • shouldUpdate(stateChange: object, nextOpts: Props): boolean

Static trigger

  • trigger(event: string, ...args: any[]): this
  • Execute all callback functions registered for specified list of events

    Parameters

    • event: string

      Event name

    • Rest ...args: any[]

      Arguments provided to callbacks

    Returns this

Static unexpose

  • unexpose(alias: string): void

Static unmount

  • unmount(keepTheParent?: boolean): void
  • Detach the tag and its children from the page.

    Parameters

    • Optional keepTheParent: boolean

      If true unmounting tag doesn't remove the parent tag

    Returns void

Static update

  • update(data?: any): void
  • Updates all the expressions on the current tag instance as well as on all the children.

    Parameters

    • Optional data: any

      Context data

    Returns void

Static updateAlias

  • updateAlias(alias: string, value: any): void

Generated using TypeDoc