Echo JS 0.11.0


xat comments

xat 309 days ago. link 1 point
Btw, the guy you are judging is a developer from the UK.
xat 310 days ago. link 1 point
If someone explicitly passes in "const opts = { name: null }" then I would argue that he wants name to be null and it should not be overwritten by what is defined in defaults. But I agree with you that there may be some (rare?) cases where some other behaviour is wanted.
xat 310 days ago. link 2 points
The way Object.assign is usually used is like this:

const opts = Object.assign({}, defaults, options);

It will fallback to the properties defined in defaults if they don't exist in options.

Nowadays you can also use destructering to achieve the same:

const opts = { ...defaults, ...options };
xat 310 days ago. link 1 point
You can check for the existence of a property with obj.hasOwnProperty('someProp').
xat 310 days ago. link 1 point
You are welcome to write your next blog post in german (without mistakes) ;-)

The guy you are judging is a junior developer from Serbia btw.
xat 310 days ago. link 2 points
We usually namespace the constants like this:

export const FOO = '<namespace>/FOO';

Wouldn't want to type the namespace every time...
xat 310 days ago. link 4 points
Not all of us are native english speakers.
xat 311 days ago. link 3 points
You will get downvoted just because of the 'React killer' in the title.
xat 311 days ago. link 2 points
Thanks for open sourcing your library. Mostly I write tree-helper functions on a project base, but would definitly be open to try this library next time.

Just skimmed through the code, here are some ideas/suggestions:

- You already have this on your TODO, but being able to use other property-names besides 'children', 'id' etc. would be cool. For example, often the term 'items' is used instead of 'children'.

- Often I need to have additional information about the node in the iterate function. For example, it could be quite useful to have access to the parentNode, the siblings or know the current depth.

- Since this is more like a small helper library, developers will look at the bundle size in order to decide if it's worth pulling this into a frontend project. You could reduce the size by not using lodash for example. I also don't think it's really necessary to have baked in currying, developers can add that, if they need it.
xat 311 days ago. link 1 point
Thanks for this library!

One suggestion: Maybe you could state in the README that this library is more like an additional layer of protection. Because some developers may think that they don't need todo any additional checking of the input. But of course, even with this library installed, you shouldn't do stuff like `SELECT * FROM foo WHERE bar=${req.query.baz}`.