Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "connect"

Index

Type aliases

Functions

Type aliases

Component

Component: ComponentClass<mixed>

Generic React component class.

connector

connector: (publicApi: { dispatch: (hash: string, mutation: mixed) => void; mutate: (hash: string, mutation: mixed) => void }) => Component

Function that exposes Store's public methods to component for internal use.

Type declaration

    • (publicApi: { dispatch: (hash: string, mutation: mixed) => void; mutate: (hash: string, mutation: mixed) => void }): Component
    • Parameters

      • publicApi: { dispatch: (hash: string, mutation: mixed) => void; mutate: (hash: string, mutation: mixed) => void }
        • dispatch: (hash: string, mutation: mixed) => void
            • (hash: string, mutation: mixed): void
            • Parameters

              • hash: string
              • mutation: mixed

              Returns void

        • mutate: (hash: string, mutation: mixed) => void
            • (hash: string, mutation: mixed): void
            • Parameters

              • hash: string
              • mutation: mixed

              Returns void

      Returns Component

mixed

mixed: any

Any valid JavaScript primitive.

Functions

connect

  • connect(store: Store, mapper: Mapper): (Anonymous function)
  • Connects the given diox Store to React component. Once component is mounted in the DOM, it automatically subscribes to modules and combiners specified in the mapper, and its state is filled with those values. All subscriptions are removed right before unmounting component.

    Parameters

    • store: Store

      diox Store to bind to the component.

    • mapper: Mapper

      diox Mapper to register on component mounting.

    Returns (Anonymous function)

    React connected component.

Generated using TypeDoc