Options
All
  • Public
  • Public/Protected
  • All
Menu

@sensenet/redux-promise-middleware

Index

Variables

Functions

Variables

Const suffixes

suffixes: string[] = ['LOADING', 'SUCCESS', 'FAILURE']

Functions

Const isPromise

  • isPromise(obj: any): boolean
  • Method checking if the given object is a Promise or not.

    Parameters

    • obj: any

      The object that should be checked. Usage example:

      ``` import { isPromise } from '@sensenet/redux-promise-middleware'

      isPromise(myObject)

    Returns boolean

Const promiseMiddleware

  • promiseMiddleware(repository: any): (Anonymous function)
  • Redux middleware to handle async actions in @sensenet/redux

    Parameters

    • repository: any

      resporitory of the application. Usage example:

      ``` import { Repository } from '@sensenet/client-core' import { promiseMiddleware } from '@sensenet/redux-promise-middleware'

      const repository = new Repository({ repositoryUrl: 'https://mySensenetSite.com' }, async () => ({ ok: true } as any)) const store = createStore( rootReducer, persistedState, applyMiddleware([promiseMiddleware(repository)]), )

    Returns (Anonymous function)

Generated using TypeDoc