svelte-legos
svelte-legos copied to clipboard
Hooks do not exist in Svelte, consider renaming these actions by removing the "use" part
Hooks do not exist in Svelte. They are a React feature. Please consider renaming all these by removing the use
from the action name.
Compare: use:counter
and use:useCounter
.
See, I was even confused by the naming convention. I assumed all the useX
were actions, but looks like they are stores. Call them what they are, custom stores, not hooks.
And for the actions, remove the action
part of the name
Thanks, @kevmodrome for the suggestions, totally makes sense.
Resolved, I think we should preserve the type action
in the actions, used them as suffix rather than prefix, now they read as for example, use:draggableAction.
@kevmodrome let me know what you think.
So - I think it's quite redundant to call them somethingSomethingAction
- can I suggest maybe doing something like this:
For actions:
import { clickOutside } from 'svelte-legos/actions
and for the custom stores:
import { counter } from 'svelte-legos/stores
As soon as you use them in Svelte it's obvious what they are: use:x
- it's an actions. $counter
it's a store :)