Skip to content
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

Enhancement: Rename Actions/Stores #53

Open
Antonio-Bennett opened this issue Mar 19, 2023 · 2 comments
Open

Enhancement: Rename Actions/Stores #53

Antonio-Bennett opened this issue Mar 19, 2023 · 2 comments

Comments

@Antonio-Bennett
Copy link

I'm of the opinion that actions should be renamed to drop the "Action" label from imports. This is because the use: syntax indicates that it is an action. Here is also the thread on Twitter discussing the possibility of renaming stores into readable and writable variants. https://twitter.com/ankurpsinghal/status/1637505767757455365?s=46&t=vXFY1pu_gVqC1tnNxYJ_Ow

Below are the different options versus currently.

//Current
import { hoverAction } from "svelte-legos";

//suggested
import { hover } from "svelte-legos";

This gives us

<div use:hoverAction on:hover={handler} />

//versus 

<div use:hover on:hover={handler} />

In terms of stores, appending Store isn't bad but as per the thread maybe explicitly stating readable/writable would be better.

The options are

import { hoverStore } from "svelte-legos";

//versus

//This one seems to make the most sense to me
import { readableHover } from "svelte-legos";

//or maybe

import { hoverReadable } from "svelte-legos";
@symsmith
Copy link
Contributor

I very much agree with this - see also #8 on the same topic

@Antonio-Bennett
Copy link
Author

Yeah reading through that thread it would be nice if the imports are from either svelte-legos/actions or svelte-legos/stores that way it's even more explicit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants