aretherecookies-mobile/js/helpers/ImmutableHelpers.js
2017-08-27 14:29:37 -05:00

11 lines
313 B
JavaScript

// @flow
import { type List, type Map } from 'immutable';
export const pushInto = <T>(list: List<T>, item: T): List<T> => list.push(item);
export const setById = (map: Map<string, any>, item: ?{ id?: string }): Map<string, any> => {
if (!item || !item.id) {
return map;
}
return map.set(item.id, item);
};