markdalgleish / redial

Universal data fetching and route lifecycle management for React etc.
1.1k stars 42 forks source link

Use transducers in trigger function for speed optimizations. #11

Closed yacodes closed 8 years ago

yacodes commented 8 years ago

@markdalgleish Thanks for such awesome lib, very straightforward and simple way to fetch component's data. I rapidly rewrote trigger function with transducers usage for optimizations and speed of mapping and filtering. Also i updated tests for transducers. I would like to hear your opinion about that. Thanks again!

markdalgleish commented 8 years ago

Thanks for the PR!

I'm planning to merge this in, but I'll drop the transducer tests as I generally try to avoid testing library internals so that refactoring is encouraged. Would you mind removing them from this PR?

It doesn't have to block this PR being merged, but perhaps you could create separate repos for trmap and trfilter and publish them to npm independently? I've looked around and can't seem to find a nice way to pull in micro transducer functions. Everything seems to be bundled into big libraries, which isn't great if you're writing a library and only need a tiny subset of the functionality, so it'd be awesome if you help fix that :smile:

yacodes commented 8 years ago

@markdalgleish I'll try to find some module libraries, providing such functionality, if not i will create some modules like lodash.map and update this PR. It will take some time, but i'll try to update everything tomorrow.