babel-plugin-extensible-destructuring icon indicating copy to clipboard operation
babel-plugin-extensible-destructuring copied to clipboard

Not work: destruct function arguments with immutable objects

Open erictsangx opened this issue 8 years ago • 3 comments

function read({a, b, c}) {
    console.info(a) //ppp
    console.info(b) //11
}
read({a: "ppp", b: 11})
function read({a, b, c}) {
    console.info(a) //undefined
    console.info(b) //undefined
}
read(fromJS({a: "ppp", b: 11}))

Now I have to destruct immutable objects inside the functions and it works prefectly:

function read(obj) {
   const {a,b} = obj
 ...
}

erictsangx avatar Jul 27 '16 04:07 erictsangx

+1

brunolemos avatar Dec 02 '16 04:12 brunolemos

Whyyy!!!? .... :D no seriously why this hasn't been fixed yet?

hendrul avatar Nov 21 '17 18:11 hendrul

@hendrul maybe because you haven't submitted your pull request yet?

hleumas avatar Nov 28 '17 12:11 hleumas