Skip to content

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.

2 participants