@lighthouse/sdk
Advanced tools
Comparing version 9.0.2-maps to 9.0.3-maps
@@ -17,2 +17,10 @@ 'use strict'; | ||
var _isArray = require('lodash/isArray'); | ||
var _isArray2 = _interopRequireDefault(_isArray); | ||
var _transform = require('lodash/transform'); | ||
var _transform2 = _interopRequireDefault(_transform); | ||
var _errors = require('../../../errors'); | ||
@@ -100,2 +108,15 @@ | ||
// handle bulk save | ||
if ((0, _isArray2.default)(action.data)) { | ||
// NOTE we're assume bulk save is for new items only | ||
var entities = (0, _transform2.default)(action.data, function (result, entity) { | ||
return result[entity._id] = { | ||
state: states.RESOLVED, | ||
entity: entity | ||
}; | ||
}, {}); | ||
state = state.merge(entities); | ||
return state; | ||
} | ||
state = state.setIn([action.data._id, 'state'], states.RESOLVED); | ||
@@ -102,0 +123,0 @@ state = state.setIn([action.data._id, 'optimistic'], false); |
{ | ||
"name": "@lighthouse/sdk", | ||
"version": "9.0.2-maps", | ||
"version": "9.0.3-maps", | ||
"description": "Lighthouse.io SDK for JavaScript applications", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
404191
5569