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

axios-actions

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-actions

Bundle endpoints as callable, reusable services

  • 4.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Axios Actions

Bundle endpoints as callable, reusable services

Abstract

Axios Actions comprises a small set of classes which collate URLs or URL request configs as callable actions.

First, define your endpoints:

const actions = {
  <action>: '<url>',
  <action>: '<config>',
  ...
}

Then, encapsulate them as one of the built-in services:

const service = new <ApiClass>(axios, actions)

Finally, call them:

service
  .<action>(<data>)
  .then(<handler>)

This service-based approach:

  • removes brittle configuration from components and stores
  • encapsulates additional logic (such as load state and handlers) within the service
  • ensures application code stays simple and semantic
  • provides a dedicated layer for API interaction

There are lots of other goodies in the library which take the drudgery out of working with APIs!

Documentation

Start reading:

Next steps

Demos:

Installation:

npm i -S axios-actions

Keywords

FAQs

Package last updated on 17 Dec 2018

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