Gathering detailed insights and metrics for @shoutem/redux-io
Gathering detailed insights and metrics for @shoutem/redux-io
Gathering detailed insights and metrics for @shoutem/redux-io
Gathering detailed insights and metrics for @shoutem/redux-io
npm install @shoutem/redux-io
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
104 Stars
588 Commits
14 Forks
23 Watchers
98 Branches
15 Contributors
Updated on Jun 25, 2025
Latest Version
3.2.5
Package Id
@shoutem/redux-io@3.2.5
Unpacked Size
219.91 kB
Size
39.70 kB
File Count
55
NPM Version
6.14.15
Node Version
12.22.7
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
11
25
redux-io
is library for data management of network data in redux
and ease of data use in react
. Consists of middleware, reducers, action creators and helpers that provide:
redux
redux
actionsreact
reselect
Redux is a great library, but it’s not a framework. It’s based on simple concepts that enable the freedom to build, but without clear patterns. But how are you going to manage network data and organize it in store, make async requests, normalize data, handle errors, cache data, monitor data statuses? At Shoutem we developed platform based on react
ecosystem in which we use redux
for managing data. We learned a lot about problems and discovered practices that give answers to above questions. All that is used in development of redux-io
library that we use everyday and enables us powerful data management.
Install redux-io
:
1$ npm install --save @shoutem/redux-io
Import middlewares apiMiddleware
, apiStateMiddleware
and add them to your createStore
in applyMiddleware
function from redux
. We are internally using [redux-api-middleware@2.0.0-beta.1
] (https://github.com/agraboso/redux-api-middleware/tree/next) as library for async network requests, so that is the reason you need to add both middlewares respectively.
Example:
1import { applyMiddleware, compose, createStore } from 'redux'; 2import { apiMiddleware } from 'redux-api-middleware'; 3import { apiStateMiddleware } from '@shoutem/redux-io'; 4import createLogger from 'redux-logger'; 5import thunk from 'redux-thunk'; 6import reducer from './reducers' 7 8const logger = createLogger(); 9 10const store = createStore( 11 reducer, 12 applyMiddleware(thunk, apiMiddleware, apiStateMiddleware, logger) 13);
And you are ready to start organizing state, configuring network resources, manage data with actions and use them in react components. Next section gives short intro in usage of redux-io in most common use cases.
For example, you have json-api API endpoint that enables you to fetch items of type acme.items
. You want to get most popular items, so endpoint http://api.test.com/items?sort=relevance
returns you list of items sorted by popularity:
1{ 2 "data": [ 3 { 4 "type": "acme.items", 5 "id": "1", 6 "attributes": { 7 "name": "Rocket", 8 } 9 }, 10 { 11 "type": "acme.items", 12 "id": "2", 13 "attributes": { 14 "name": "Helmet", 15 } 16 }, 17 ... 18 ] 19}
First you want to configure where fetched data will be placed in your state. Use storage
as a normal reducer to define where in your state are instances of objects, and collection
reducer to set place in the state for list holding ids of items that are popular. You are probably asking why do you need those two reducers, but idea is to keep data in redux state normalized. Normalization instances needs to be in one place in the state. However, you can reference it from mutliple parts in the state.
1import { storage, collection } from `redux-api-state`; 2 3combineReducers({ 4 items: storage('acme.items'), 5 popularItems: collection('acme.items', 'popularItems'), 6})
After that, you only need to dispatch find
action to fetch popular items from API. Find action is based on redux-api-middleware, and only needs to additional params schema
, and tag
. Schema defines in which storage
will fetched data end up, and tag
defines which collection
will fetch ids of objects.
1import { find } from `redux-api-state`; 2 3const config = { 4 endpoint: 'http://api.test.com/items?sort=relevance', 5 headers: { 6 'Content-Type': 'application/vnd.api+json', 7 }, 8}; 9 10dispatch(find(config, 'acme.items', 'popularItems'));
Upon dispatch, find
will configure action by redux-api-middleware specification, and redux-api-middleware will
You can see that it is by redux-api-middleware
lifecycle. After which redux-api-state will listen on SUCCESS action and will act as:
Storage reducer only adds an item if action is valid and schema value is equal to the action's schema. Collection reducer performs the same, but checks also tag
value. That enable us to have multiple collections of objects, but only one storage with instances of objects. Here is the state after app finished fetching:
1state: { 2 items: { 3 1: { 4 "type": "acme.items", 5 "id": "1", 6 "attributes": { 7 "name": "Rocket", 8 } 9 }, 10 2: { 11 "type": "acme.items", 12 "id": "2", 13 "attributes": { 14 "name": "Helmet", 15 } 16 }, 17 }, 18 popularItems: [1, 2, 3, ... ], 19}
1$ npm install && npm test
The package is based on concepts from Željko Rumenjak.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/10 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
62 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More