gpbl / denormalizr

Denormalize data normalized with normalizr
https://www.npmjs.com/package/denormalizr
MIT License
228 stars 24 forks source link

Denormalizing a list of ids #33

Closed basimhennawi closed 7 years ago

basimhennawi commented 7 years ago

So in the examples you mentioned that we can denormalize using 4 different overloads/types for the input parameters as follow:

Well. Actually when I try normalizing by passing the id, it works like this:

Case A: const denormalized = denormalize(1, normalized.entities, articleSchema);

Case B: But when I pass a list of the same id, it don't, like this:

const denormalized = denormalize([1], normalized.entities, articleListSchema);

I checked the test files and I noticed you use to loop on it manually like this:

Case C: const denormalized = [1].map(id => denormalize(id, normalized.entities, articleListSchema));

So am I missing to have Case B working without using loop like in Case C. Thanks in advance!

gpbl commented 7 years ago

This should have been fixed upgrading to last normalizr and to denormalizr v0.5.0. Please reopen if not, thanks 👍