Socket
Book a DemoInstallSign in
Socket

reapop-redux-axios-middleware

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reapop-redux-axios-middleware

Redux middleware to trigger reapop's notifications from axios actions.

0.5.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

reapop-redux-axios-middleware

Redux middleware to trigger reapop's notifications from axios actions.

Build Status

Overview

This module allows you to dispatch notifications from axios actions using reapop.

Installation

Fist, install redux-axios-middleware and reapop. Then:

npm i -S reapop-redux-axios-middleware

Notifications

export const saveProfile = (userId, profile) => {
  return {
    types: [SAVE_PROFILE_REQUEST, SAVE_PROFILE_SUCCESS, SAVE_PROFILE_FAILURE],
    payload: {
      request: {
        url: `/users/${userId}`,
        method: 'PUT',
        data: profile,
      },
      messages: [{
        title: 'Profile',
        message: 'The profile was saved!',
        status: 'success',
        dismissible: true,
        dismissAfter: 3000
      }, 
      {
        title: 'Profile',
        message: 'Error saving the profile.',
        status: 'error',
        dismissible: true,
        dismissAfter: 3000
      }]
    }
  };
};

Keywords

redux

FAQs

Package last updated on 22 Oct 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.