Skip to content

Instantly share code, notes, and snippets.

View digitalsadhu's full-sized avatar

Richard Walker digitalsadhu

View GitHub Profile
@eiriklv
eiriklv / populating-graph-using-naming-conventions.js
Last active July 16, 2017 13:43
Populating graphs using proxies
/**
* Dependencies
*/
const { plural } = require('pluralize');
/**
* Get an item from an array collection by id
*/
const getByIdFromArray = (collection = []) => (id = '') => {
return collection.find((item = {}) => item.id === id);