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

@hydrogenjs/redux-hydrogen

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hydrogenjs/redux-hydrogen - npm Package Compare versions

Comparing version 0.3.5 to 0.4.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="0.4.0"></a>
# [0.4.0](https://github.com/Lemonpeach/redux-hydrogen/compare/v0.3.5...v0.4.0) (2018-06-26)
### Features
* **redux-hydrogen:** handle paginated data ([d959933](https://github.com/Lemonpeach/redux-hydrogen/commit/d959933))
<a name="0.3.5"></a>

@@ -8,0 +19,0 @@ ## [0.3.5](https://github.com/Lemonpeach/redux-hydrogen/compare/v0.3.4...v0.3.5) (2018-06-16)

2

lib/reducers/data-reducer.js

@@ -37,3 +37,3 @@ 'use strict';

}
var r = [(0, _modifiers.insert)(data), (0, _modifiers.pending)(false)];
var r = [(0, _modifiers.insert)(data.data || data), (0, _modifiers.pending)(false)];
if ((0, _actions.isQuery)(type)) {

@@ -40,0 +40,0 @@ r.push((0, _modifiers.queried)(verb, query));

{
"name": "@hydrogenjs/redux-hydrogen",
"version": "0.3.5",
"version": "0.4.0",
"description": "Don't waste your time writing redux boilerplate.",

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

@@ -78,2 +78,19 @@ import { getType, verbs, stages } from 'actions/actions';

test('handles paginated insert action', () => {
const state = {};
const { reducer } = require('../data-reducer');
reducer(state, {
data: {
data: [{ id: 1 }, { id: 2 }], skip: 10, limit: 10, total: 250
},
verb: verbs.FIND,
type: getType(verbs.FIND, 'people', stages.FULFILLED)
});
const { insert, pending } = require('../modifiers');
expect(insert).toHaveBeenCalledWith([{ id: 1 }, { id: 2 }]);
expect(insert()).toHaveBeenCalledWith(state);
expect(pending).toHaveBeenCalledWith(false);
expect(pending()).toHaveBeenCalledWith(state);
});
test('handles query insert action', () => {

@@ -80,0 +97,0 @@ const state = {};

@@ -22,3 +22,3 @@ import { isPending, isFulfilled, isRejected, isQuery, isRemove, isReset } from 'actions';

}
const r = [insert(data), pending(false)];
const r = [insert(data.data || data), pending(false)];
if (isQuery(type)) {

@@ -25,0 +25,0 @@ r.push(queried(verb, query));

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