Replies: 2 comments 2 replies
-
I think this would maybe be tricky to identify the different call sites to associate state with each one unlike with a macro where each call has its own code (expr). I think @dralletje made a |
Beta Was this translation helpful? Give feedback.
-
I'm thinking more about this, there are lots of use cases that only work if PlutoHooks can be used "behind the scenes" in a function call or It also makes it easier to write other hooks that use PlutoHooks, right now that's pretty complex with all the escaping. Is it possible to make all the hooks available as a function? It could be implemented like preact: every cell has a counter of which hook is being called? @schlichtanders Already uses PlutoHooks with functions instead of macros, right? How does that work? |
Beta Was this translation helpful? Give feedback.
-
It would be really cool if in this example, both calls to
f
would have their own ref. This would mean that you can "package up" a component written using hooks into a function (in another package), and people just call the function.Schermopname.2021-12-01.om.21.55.49.mov
Beta Was this translation helpful? Give feedback.
All reactions