-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
EventSource.emit docs are misleading for Hooks #48
Comments
Thanks for pointing this out, @milesfrain. I think there are two things we can do for now, and maybe we can do even more in the future to make this clear. First, it's a decent approximation to replace any use of Second, I'm happy to add an example to this repository that uses subscriptions and event sources, as there is no existing example. Ideally it would be something smaller than the Ace example (perhaps a timer or something like that) just to avoid needing to keep up to date with a third-party component. I'm open to other suggestions for how to make this "action" distinction more clear as well. |
Just FYI. |
I've added labels for this as it's something that could be added to the project documentation (even if just by copy/pasting my description into the docs somewhere). |
is this issue still relevant now that this functionality got moved into |
A fix is possible in the main Halogen code, but the issue only affects Hooks users, so I wouldn't consider it a regular Halogen issue.
The help docs for
emit
are a bit too specific, wherea
is assumed to be an "action".This assumption is fine for regular Halogen, and I can't think of a situation where you'd want to use anything besides a component's
Action
type, but this is misleading for usage with Hooks becausea
needs to beHookM m Unit
.I don't know what the best strategy is for improving Halogen docs that require a different interpretation for Hooks. Making the Halogen docs too generic may be more confusing for beginners. Perhaps more Hooks examples would help. There's nothing available yet demonstrating
effectEventSource
andaffEventSource
.For context here's a partial Ace example with
effectEventSource
. Considering adding something like this to the cookbook.The text was updated successfully, but these errors were encountered: