It's a (bad?) habit of mine from the bad old days of JS libs being of poor quality and accidentally (or intentionally!) overriding undefined with something else. Turns out, it's a micro-performance optimization to use void 0 and it is safer.
I also find that writing undefined is usually an anti-pattern (usually, you want null to express that the value is unset).
It's a (bad?) habit of mine from the bad old days of JS libs being of poor quality and accidentally (or intentionally!) overriding `undefined` with something else. Turns out, it's a micro-performance optimization to use `void 0` and it _is_ safer.
I also find that writing `undefined` is usually an anti-pattern (usually, you want `null` to express that the value is unset).
mdibaiee
(Migrated from github.com)
reviewed 2016-10-21 09:14:18 +00:00
Oh, you might be surprised to know that I didn't know it would return undefined, I mean I've never seen void anywhere before 😁, is there a problem with null here?
Oh, you might be surprised to know that I didn't know it would return `undefined`, I mean I've never seen `void` anywhere before :grin:, is there a problem with `null` here?
joeybaker
(Migrated from github.com)
reviewed 2016-10-21 18:04:40 +00:00
Well… sorta, it makes https://github.com/mdibaiee/hapi-sequelize-crud/pull/25/files#diff-e23df694a8f901b18511b648fe2416b9R202 harder if it's `null`. I can re-work this though.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Allows passing these as query params to list and scope methods.
There are a few small unrelated fixes in here as well.
@mdibaiee if you get a chance, let me know what you think!
@joeybaker Thanks Joey! looks fine to me except for the comment I had 😁 👍
Just out of curiosity: why
void 0?It's a (bad?) habit of mine from the bad old days of JS libs being of poor quality and accidentally (or intentionally!) overriding
undefinedwith something else. Turns out, it's a micro-performance optimization to usevoid 0and it is safer.I also find that writing
undefinedis usually an anti-pattern (usually, you wantnullto express that the value is unset).Oh, you might be surprised to know that I didn't know it would return
undefined, I mean I've never seenvoidanywhere before 😁, is there a problem withnullhere?Well… sorta, it makes https://github.com/mdibaiee/hapi-sequelize-crud/pull/25/files#diff-e23df694a8f901b18511b648fe2416b9R202 harder if it's
null. I can re-work this though.Merging!
Released as 2.7.0
@joeybaker Thanks! 👍