Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@specter/redux-effects-specter

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@specter/redux-effects-specter

redux middleware of specter client

  • 0.7.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

redux-effects-specter

specter binding for redux-effects family.

Installation

npm install --save redux-effects-specter

Usage

Installing the middleware:

import { createStore, applyMiddleware } from 'redux';
import { Client } from '@specter/specter';
import stepsMiddleware from 'redux-effects-steps';
import specterMiddleware from '@specter/redux-effects-specter';
import rootReducer from './reducers';

const client = new Client({
  base: '/xhr'
});

const store = createStore(
  rootReducer,
  applyMiddleware(
    stepsMiddleware,
    fetchrMiddleware(fetchr)
  )
);

Defining action creators:

import { createAction } from 'redux-actions';
import { steps } from 'redux-effects-steps';
import { specterRead } from '@specter/redux-effects-specter';

const fetchUserRequest = createAction('FETCH_USER_REQUEST');
const fetchUserSuccess = createAction('FETCH_USER_SUCCESS');
const fetchUserFail = createAction('FETCH_USER_FAIL');

function fetchUser(user) {
  return steps(
    fetchUserRequest(),
    specterRead('users', { user }),
    [fetchUserSuccess, fetchUserFail]
  );
}

API (Action Creators)

specterCreate

  • types
(service: string, options: { query?: object; body?: object; headers?: object } = {}): Promise

specterUpdate

  • types
(service: string, options: { query?: object; body?: object; headers?: object } = {}): Promise

specterDelete

  • types
(service: string, options: { query?: object; headers?: object } = {}): Promise

specterRead

  • types
(service: string, options: { query?: object; headers?: object } = {}): Promise

Keywords

FAQs

Package last updated on 06 Nov 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc