Skip to content

Instantly share code, notes, and snippets.

View josegl's full-sized avatar
:octocat:

Jose G.L. josegl

:octocat:
View GitHub Profile
@josegl
josegl / current-actions.js
Last active November 17, 2015 10:47
Best redux way to extract an item from an array
let action = (id, items) => {
return {
type: ACTION_TYPE;
item: items.filter(i => id === i._id)[0] // item with id will always exists in the array
}
}
@josegl
josegl / git diff
Created October 28, 2015 10:48
passing to es6 class
diff --git a/server/modules/ventaLead/lib/VentaLead.js b/server/modules/ventaLead/lib/VentaLead.js
index 563c2bc..dede967 100644
--- a/server/modules/ventaLead/lib/VentaLead.js
+++ b/server/modules/ventaLead/lib/VentaLead.js
@@ -5,87 +5,76 @@ var Car = require('../../car');
var util = require('../../../../lib/util');
var Canalcar = require('../../../../lib/canalcarApiClient');
-var VentaLead = function (rawVentaLead){
- var self = this;