denormalizr icon indicating copy to clipboard operation
denormalizr copied to clipboard

Doesn't support using a function in getIdAttribute

Open lingard opened this issue 9 years ago • 2 comments

Normalizr allows you to pass a function to idAttribute instead of a string but as denormalizr seems to assume that the returned value from schema.getIdAttribute is a string it won't work.

https://github.com/gpbl/denormalizr/blob/3213960e64af3894e711616d9c536ad0a7ed0ab2/src/index.js#L23

I guess I could work around this issue by plucking the id attributes from my objects before denormalizing but that doesn't feel optimal...

lingard avatar Nov 01 '16 19:11 lingard

Thanks @lingard I wasn't aware it could be a function. Working on this in the next days if you won't send a PR first 😄

gpbl avatar Nov 03 '16 19:11 gpbl

I think https://github.com/gpbl/denormalizr/pull/35 fixed it. @lingard can you try?

brunolemos avatar Feb 11 '17 15:02 brunolemos