These are chat archives for ramda/ramda

15th
Jan 2017
James Forbes
@JAForbes
Jan 15 2017 02:22
@rickmed An alternative to dependency injection is to have your function return a description of the impure action you'd like to take, and then have a separate program for testing the generation of those descriptions, or converting those descriptions into IO. I've seen people call this the onion architecture, or the interpreter pattern. One major benefit is, no mocks.
Classic example of this pattern is virtual dom.
Sudarsan Balaji
@artfuldev
Jan 15 2017 03:38
@JAForbes well put
James Forbes
@JAForbes
Jan 15 2017 04:10
Thanks @artfuldev
Rick Medina
@rickmed
Jan 15 2017 04:16
@JAForbes free monad?
Dillon
@xudaolong
Jan 15 2017 07:20
hi
how to do to omit the temp .like that
dataCategories = (()=> { let temp = []; for (let i = 0, len = keysName.length; i < len; i++) { temp[i] = R.merge(keysName[i], dataCategories[i]); } return temp; })();

dataCategories = (()=> {
                let temp = [];
                for (let i = 0, len = keysName.length; i < len; i++) {
                    temp[i] = R.merge(keysName[i], dataCategories[i]);
                }
                return temp;
            })();
James Forbes
@JAForbes
Jan 15 2017 09:20
@xudaolong Have a look at zip in conjunction with map, might help
Dillon
@xudaolong
Jan 15 2017 09:51
thanks and i try it
Dillon
@xudaolong
Jan 15 2017 10:00
it work . R.values(R.mapObjIndexed((value, index)=> R.merge(value, keysName[index]), dataCategories))
Stefano Vozza
@svozza
Jan 15 2017 13:27
@JAForbes very interesting, you don't happen to have some real world js code that uses that pattern?