Socket
Book a DemoInstallSign in
Socket

@sensenet/redux-promise-middleware

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sensenet/redux-promise-middleware

Redux middleware for async sensenet functions

latest
Source
npmnpm
Version
2.3.1
Version published
Maintainers
8
Created
Source

@sensenet/redux-promise-middleware

sensenet's redux promise middleware enables handling of async actions in Redux based on Redux Promise Middleware. This middleware is a custom implementation of the mentioned one so install, include and use it the same way except that:

  • it needs a repository as an input param, so that sensenet repository and the related API can be used inside Actions,
  • it does not have a customizable config
  • Action suffixes are hardcoded (LOADING, SUCCESS, FAILURE)
  • Action delimiter is hardcoded '_'

NPM version NPM downloads License: GPL v2

Install

# Yarn
yarn add @sensenet/redux-promise-middleware

# NPM
npm install @sensenet/redux-promise-middleware

Setup

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

const repository = new Repository({ repositoryUrl: 'https://mySensenetSite.com' })

...

const store = createStore(
    rootReducer,
    persistedState,
    applyMiddleware([promiseMiddleware(repository)]),
)

Use

About how to use it with Actions check @sensenet/redux docs.

Keywords

sensenet

FAQs

Package last updated on 14 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts