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

A way to prevent data load when using the <ma-data> component #40

Open
DmitrySharabin opened this issue Mar 6, 2023 · 1 comment
Open
Milestone

Comments

@DmitrySharabin
Copy link
Member

DmitrySharabin commented Mar 6, 2023

If I recall correctly, <ma-data> loads data immediately. I was thinking of some use cases where it might be undesirable.

For example, suppose our data is private, and the user needs to log in to access it. So there is no need to fire load() after the component is mounted (or at some point after the page loads), only after the user logs in. But since we automatically load data after the user logs in, it perfectly suits this use case.

Another use case is if we need to use one backend as a source and another as storage. E.g., we want to copy data from one backend to another. So, it would be nice if we could prevent data loading from the storage backend.

If we decide to implement this feature, I wonder if it'll be a separate attribute or if we can follow the Vue API and have something like: <ma-data src.prevent="url"></ma-data>?

What do you think?

@LeaVerou
Copy link
Contributor

I don't think .prevent would be a good idea, as it's only ever used with event handlers.
Maybe a load attribute with values auto (default), manual, authenticated? That would also allow for future extensions to how data is loaded.

@LeaVerou LeaVerou added this to the Backlog milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants