Skip to content

automatically infer closure arguments #520

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

Merged
merged 5 commits into from
Dec 15, 2021
Merged

Conversation

rmorshea
Copy link
Collaborator

@rmorshea rmorshea commented Oct 21, 2021

I realized that we can use the __closure__ attribute of Python function objects to automatically infer their dependencies. The flake8-idom-hooks plugin might complain if you leverage this inference, but you can always turn off the check if you use this.

This also renames the args parameter for use_effect use_memo and use_callback to dependencies for explicitness. Given that it will be used less frequently the longer name seems appropriate.

  • update docs

@rmorshea rmorshea force-pushed the auto-infer-closure-args branch 2 times, most recently from bb85f37 to e9ffafd Compare October 21, 2021 03:23
@rmorshea rmorshea force-pushed the auto-infer-closure-args branch from e9ffafd to 78a31e8 Compare December 14, 2021 09:11
@rmorshea rmorshea merged commit 26c6010 into main Dec 15, 2021
@rmorshea rmorshea deleted the auto-infer-closure-args branch December 15, 2021 03:13
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

Successfully merging this pull request may close these issues.

1 participant