ivan-kleshnin / tetris-game

Tetris game implemented in CycleJS
MIT License
16 stars 4 forks source link

deep-merge deprecated #1

Closed chasm closed 9 years ago

chasm commented 9 years ago

Saw you are using deep-merge. The documentation says that it has been deprecated in favor of deep-extend.

ivan-kleshnin commented 9 years ago

Thank you! I will take a look.

ivan-kleshnin commented 9 years ago

Dunno why @raynos deprecated his library in favor of deep-extend.

Can you imagine, that this stupid library mutates first passed argument?!

import deepExtend from "deep-extend";

let a = {x: "A"};
let b = {x: "B"};

console.log(deepExtend(a, b)); // { x: 'B' }
console.log('a:', a); // { x: 'B' } ??? !!!
console.log('b:', b); // { x: 'B' }

It takes defensive cloning approach (poor thing) https://github.com/unclechu/node-deep-extend/blob/master/lib/deep-extend.js and still corrupt input...

OMG :fearful:

Of course we can deepExtend({}, a, b) but I better stick with deep-merge until Ramda 15.2 will be released.

chasm commented 9 years ago

Uh... wow. WTF? I just saw the note. Didn't look at the code. Definitely, stick with deep merge.

Thanks to you, have now started using Ramda everywhere. This morning I used it to make breakfast. Then I drove it to work. Tonight I'm watching a movie on it. OK, maybe I'm exaggerating a little. But it definitely is the best thing since sliced bread.

ivan-kleshnin commented 9 years ago

Thanks to you, have now started using Ramda everywhere. This morning I used it to make breakfast. Then I drove it to work. Tonight I'm watching a movie on it. OK, maybe I'm exaggerating a little. But it definitely is the best thing since sliced bread.

Hahaha, definitely :grin: Computer Science rules.