New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-arc

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-arc - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

2

package.json
{
"name": "redux-arc",
"version": "0.6.1",
"version": "0.6.2",
"description": "Abstraction layer to simplify rest api calls in redux",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -16,3 +16,3 @@ <img src="https://github.com/viniciusdacal/redux-arc/blob/master/arc-64.png?raw=true" height="64" />

## Creators and types are generated by a config
## Action creators and types generated by a config

@@ -25,6 +25,7 @@ ```js

add: null,
reset: null
});
```
## Create reducers using createReducers and types:
## Create reducers reusing types and without switch cases:

@@ -36,4 +37,13 @@ ```js

const INITIAL_STATE = [];
const onAdd = (state, action) => [
...state,
action.payload,
];
const onReset = () => INITIAL_STATE;
const HANDLERS = {
[types.ADD]: (state, action) => [...state, action.payload]
[types.ADD]: onAdd,
[types.onReset]: onReset,
};

@@ -49,9 +59,16 @@

const payload = {
name: 'Luke',
master: 'Yoda',
};
const payload = { name: 'Luke' };
const meta = { foo: 'bar' };
dispatch(creators.add(payload, meta))
dispatch(creators.add(payload, meta));
/*
{
type: 'JEDI_ADD',
payload: { name: 'luke' },
meta: { foo: 'bar' },
}
*/
dispatch(creators.reset());
// { type: 'JEDI_RESET' }
```

@@ -73,10 +90,10 @@

```
> createActions creates both, regular and async actions. Async types has REQUEST and RESPONSE type, respectively to when a request starts and when it finishes.
> createActions creates both, regular and **Async Actions**. Async types has **REQUEST** and **RESPONSE** type, respectively to when a request starts and when it finishes.
# Getting started
#Getting started
```bash
yarn add redux-arc
```
or

@@ -83,0 +100,0 @@

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