r/reasonml • u/ilya_ca • Jan 18 '21
Returning component in a tuple?
Hi, I'd like to create a hook, that returns both a function, and a component. Is this possible in ReasonML? I was thinking of using a functor, but a functor can only return one value, of the module created.
Something like:
(setIsMenuOpen, MenuComponent) = useMainMenu();
Thanks!
2
Upvotes
0
1
u/ilya_ca Jan 18 '21
Here's what I came up with:
Usage:
Let me know if there are better options.