Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Confusion about Composables #1955

Unanswered
abitwhy asked this question in Q&A
Discussion options

image

What's the stateful logic of the useEventListener in Mouse Tracker Example? It looks like a normal function.

You must be logged in to vote

Replies: 2 comments

Comment options

In my opinion, Composables are usual normal functions. This example shows us how easy we can divide some code logic into small composables(functions) and reuse this logic into components or other composables.

You must be logged in to vote
0 replies
Comment options

I'd say it is because you are altering the target object by adding/removing event listener to it.

But TBH, so far I am struggling to divide composables/utils properly in my main work project. It is fairly easy to mix them up during development and then quite hard to split them again...

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /