digirati-annotation-redux
Advanced tools
Comparing version 0.1.17 to 0.1.18
export var ANNOTATIONS_ADD = 'ANNOTATIONS_ADD'; | ||
export function addAnnotation(annotation) { | ||
return { type: ANNOTATIONS_ADD, payload: { annotation: annotation } }; | ||
return { type: ANNOTATIONS_ADD, payload: { id: annotation.id, annotation: annotation } }; | ||
} |
@@ -5,3 +5,3 @@ import { ANNOTATIONS_ADD } from '../actions/annotations'; | ||
var defaultState = { | ||
list: [] | ||
list: {} | ||
}; | ||
@@ -14,4 +14,6 @@ | ||
if (action.type === ANNOTATIONS_ADD) { | ||
var _list; | ||
return update(state, { | ||
list: { $push: [action.payload.annotation] } | ||
list: (_list = {}, _list[action.payload.id] = { $set: action.payload.annotation }, _list) | ||
}); | ||
@@ -18,0 +20,0 @@ } |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function addAnnotation(annotation) { | ||
return { type: ANNOTATIONS_ADD, payload: { annotation: annotation } }; | ||
return { type: ANNOTATIONS_ADD, payload: { id: annotation.id, annotation: annotation } }; | ||
} |
@@ -15,3 +15,3 @@ 'use strict'; | ||
var defaultState = { | ||
list: [] | ||
list: {} | ||
}; | ||
@@ -24,4 +24,6 @@ | ||
if (action.type === _annotations.ANNOTATIONS_ADD) { | ||
var _list; | ||
return (0, _immutabilityHelper2.default)(state, { | ||
list: { $push: [action.payload.annotation] } | ||
list: (_list = {}, _list[action.payload.id] = { $set: action.payload.annotation }, _list) | ||
}); | ||
@@ -28,0 +30,0 @@ } |
{ | ||
"name": "digirati-annotation-redux", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "Describe annotation-redux here", | ||
@@ -5,0 +5,0 @@ "main": "es/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52081
1252