A Vue component that simplifies rendering logic based on promise states (pending, fulfilled, rejected).
vue-prom is a Vue.js wrapper component that simplifies rendering UI based on asynchronous promise states. It automatically handles loading, success, and error states, allowing developers to declaratively manage async content without manual state tracking. The component reduces boilerplate code by providing scoped slots for promise results and errors.
Vue.js developers building applications with asynchronous data fetching, such as APIs, dashboards, or dynamic content loaders. It's particularly useful for those looking to reduce repetitive promise state logic in templates.
Developers choose vue-prom because it eliminates verbose conditional rendering and manual promise state management, offering a clean, declarative approach. Its scoped slots and automatic reactivity make async UI updates straightforward and maintainable.
Vue promise wrapper component
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically updates UI based on promise states (pending, fulfilled, rejected), eliminating manual loading and error flags as shown in the README comparison.
Provides scoped slots for accessing promise results and errors directly in templates, reducing verbose conditional rendering like v-if/v-else.
Watches promise and refresh props to re-execute the promise when either changes, ensuring UI stays in sync with data without extra code.
All slots are optional with default labels (e.g., 'Loading...', 'Error'), simplifying common use cases without custom markup.
Uses Vue 2's slot-scope syntax, which is not natively compatible with Vue 3's Composition API, limiting adoption in newer projects.
As the README admits, it's unsuitable for scenarios requiring function calls in promise callbacks, such as storing results in Vuex or triggering notifications.
Lacks features for automatic promise retries or error recovery, forcing developers to handle complex error scenarios manually.