Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vue-recomputed-async
Advanced tools
Vue.js extended computed composable with async, initial state & manual refresh support
Readme
Vue.js extended computed composable with async, initial state & manual refresh support this library aims to provide better code integration by providing a single function that eliminate the need to create and call a fetch function, creating a sperate loading & data objects manually handling the fetch function errors, lazy evualation, providing an initial default state in case of in progress evaluation or failure
computed()
& vueuse
computedAsync()
:Feature | computed() | computedAsync() | recomputedAsync() |
---|---|---|---|
Dependency Tracking & Reactivity | ✅ | ✅ | ✅ |
Async Support | ❌ | ✅ | ✅ |
Initial State | ❌ | ✅ | ✅ |
Lazy Evaluation | ❌ | ✅ | ✅ |
Evaulation State | ❌ | ✅ | ✅ |
Manual Re-evaluation | ❌ | ❌ | ✅ |
npm i vue-recomputed-async
<template>
<div>
<div v-if="peopleLoading">Loading People...</div>
<div v-for="person in people" :key="person.name">
{{ person.name }}
</div>
<button @click="refreshPeople">Refresh</button>
</div>
</template>
<script setup>
import { recomputedAsync } from 'vue-recomputed-async';
import { getPeople } from './people-api'
const {
data: people,
loading: peopleLoading,
refresh: refreshPeople,
} = recomputedAsync(async () => {
return await getPeople()
}, [])
</script>
options
parameter:Since this package is an extension that uses computedAsync
composable from @vueuse/core
package the hood, you can override the options
Field | Description |
---|---|
refresh() | a function that rexecute the evaluation callback function to refresh the computed value |
data | a reactive object that holds the the value returned the callback function, if the callback failed or still evaluation, it holds the initial value provided |
loading | returns true if the callback function is still evaluating |
FAQs
Vue.js extended computed composable with async, initial state & manual refresh support
The npm package vue-recomputed-async receives a total of 2 weekly downloads. As such, vue-recomputed-async popularity was classified as not popular.
We found that vue-recomputed-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.