Open yachaka opened 8 years ago
Awesome @yachaka, thanks a lot! Please give some some time to review the changes.
@yachaka Thanks again for your PR. Yes, I see the need of a refactoring to avoid some code dupes... If you are have some time for a code review, we can work on this together, otherwise I can try updating the branch myself in the next days.
@yachaka Thanks for this. Really looking forward to this change. 🎉
@clessg Thanks for the feedback ! Really appreciated ! :) @gpbl I can look onto refactoring a little next week, if no one does !
Sorry, I've broken the PR fixing up some code in master :( The valuable code is still visible and reusable from the diff.
I will be able to look into refactoring along your comments this friday. ;)
Hey guys. Any updates on this?
@diegohaz I've been a lot busy lately (just started a new job), but I will into refactoring this week (promess 😸). For now, you can use my fork (yachaka/denormalizr) ; it works with memoization using { memoized: true }
as the first argument.
@gpbl Updated README, added some code comment. I didn't refactor the denormalize entry point function ; I think it is more readable this way - splitted into 2 functions. In term of performance, it also eliminates a check. Please review 👍
@gpbl Sup ?
Hello,
This is the PR discussed in issue #10. API follows what has been discussed :
{ memoized: true }
to activate memoization.I've been rather busy so I just added few tests and the overall code could be refactored in some points somehow but it does the job.
Needs the docs to be partly rewritten though to explain how to use/the advantages of using memoization.
Note: the cache is for now global. In the future. It would be necessary to take is as argument to allow the user to maintain a cache for each set of entity he might be using.