goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 323 forks source link

dispatchIdentity rudely omit all params when the first one is undefined. #716

Open bukuta opened 7 years ago

bukuta commented 7 years ago

I just fall in the hole these days.

https://github.com/goatslacker/alt/blob/master/src/utils/AltUtils.js#L54-L57


export function dispatchIdentity(x, ...a) {
   if (x === undefined) return null
   return a.length ? [x].concat(a) : x
 }