Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make composable with lodash.flowRight & ramda.compose #21

Closed
CurriedFloat opened this issue Aug 11, 2020 · 5 comments
Closed

Make composable with lodash.flowRight & ramda.compose #21

CurriedFloat opened this issue Aug 11, 2020 · 5 comments

Comments

@CurriedFloat
Copy link

Hi, debounceRender is great, just wished it was composable.
I'm currently wrapping debounceRender so it can be used with compose.

<--- wrapper --->
import debounceRender from 'react-debounce-render';

export const debounce = (wait = 0, options = {}) => component =>  
  debounceRender(component, wait, options);

<--- example usage --->
export default compose(
  withStyles(styles), 
  connect(
    mapStateToProps,  
    mapDispatchToProps
  ),  
  debounce(200, {maxWait: 400})
)(SomeComponent);

react docs: higher-order-components.html#convention-maximizing-composability

@podefr
Copy link
Owner

podefr commented Aug 13, 2020

Hi, thanks for the suggestion! I think it makes perfect sense. Would you be ok creating a PR to expedite the fix?

@CurriedFloat
Copy link
Author

Hi, thanks for the suggestion! I think it makes perfect sense. Would you be ok creating a PR to expedite the fix?

Yes, sure :)

@podefr
Copy link
Owner

podefr commented Aug 22, 2020

thanks for the PR! I added a few tests, updated the changelog and published version 7.0.0. Please let me know if everything works as expected for you and I'll close the issue. Thanks!

@CurriedFloat
Copy link
Author

Updated to 7.0.0 and switched to the debounce version and everything seems to be working as expected.
Thanks! :)

@podefr
Copy link
Owner

podefr commented Aug 26, 2020

👍

@podefr podefr closed this as completed Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants