Comments (3)
I can see the use case for this. The initial purpose of this library was actually the opposite: to enable you to treat a remote (or otherwise asynchronously computed) property almost as if it were fully synchronous, abstracting away the asynchronous request and making it appear like any other computed property. But I can also see why that's not always what is wanted, and your use case certainly is one that should be easy enough to add support for.
So while this isn't really the core purpose of vue-async-computed
, I'll see about adding a setting for this.
from vue-async-computed.
Using #45, you could do:
<div v-if="data && !$asyncComputed.data.updating">{{ data }}</div>
<spinner v-else/>
from vue-async-computed.
I agree, now that #45 is merged, this gives you a nice and clean way of doing what you want here.
This approach will also give you more control of what happens in each separate case: before it's loaded, after it's loaded, while it's updating, or if it had an error. I don't like the idea of blurring the distinction between the first and the third of those automatically, but of course if that's what your use case needs, you certainly should have the tools to be able to easily do that, even if it's not the default behavior of the vue-async-computed
library.
from vue-async-computed.
Related Issues (20)
- Typescript / vue-async-computed Property 'foo' does not exist on type 'CombinedVueInstance<Vue, {...} HOT 2
- Doesn't seem to deep watch properties. HOT 2
- Initial State of Async Call 'updating' set to true when using shouldUpdate()
- Vue 3 support? HOT 5
- Add support to installation as mixin.
- Make Promise as return of method update() or new method updatePromise()
- Provide option to exclude or explicitly list watched properties
- Value getting computed on route changes
- kjidjvtlcdgjj
- Use with Nuxt? HOT 1
- Provide cancel method
- implement set like get
- "this.$options is undefined" is being raised when using vue async computed
- "lazy: true" fails to stop updates HOT 1
- TypeScript support in 3.8.0 HOT 4
- Add vue-async-computed-decorator to README.md HOT 2
- Issue updating reactive variables in asyncComputed HOT 1
- asyncComputed return only default value HOT 2
- how to use this plugin with class based vue components? HOT 2
- Executed without being called, normal computed works different HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-async-computed.