Closed basimhennawi closed 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);
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));
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!
This should have been fixed upgrading to last normalizr and to denormalizr v0.5.0. Please reopen if not, thanks 👍
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!