Created
March 16, 2017 19:20
-
-
Save lfalvarez/b4e50bfe5b89a8f3e0e8ee7f885d8455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_arrayparseCsv(file_names, store){ | |
let _parseAttributes = this._parseAttributes; | |
let studies = []; | |
_parseAttributes = _parseAttributes.bind(this); | |
let hashCode = this._hashCode; | |
let parses = []; | |
let _otroCsv = this._otroCsv; | |
_otroCsv = _otroCsv.bind(this); | |
_.forEach(file_names, function(fn){ | |
let id = hashCode(fn.split('_')[1].split('-')[0] + fn.split('_')[1].split('-')[1].split('.')[0]); | |
let study = store.peekRecord('study', id); | |
parses.push(_otroCsv(fn, study)); | |
studies.push(study); | |
}); | |
let result = RSVP.allSettled(parses).then(function(resultados){ | |
let resultado_final = {'data':[]}; | |
_.forEach(resultados, function(resultado){ | |
resultado_final.data = _.concat(resultado_final.data, resultado.value.data); | |
}); | |
// console.log(JSON.stringify(resultado_final)); | |
store.pushPayload(resultado_final); | |
console.log(studies); | |
return studies; | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment