Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@dreamworld/async-tasks
Advanced tools
Readme
import * as asyncTasks from '@dreamworld/async-tasks';
import { store } from "path/to/store";
asyncTask.init(store);
import { run } from '@dreamworld/async-tasks';
try {
const result = yield call(run, taskId, fn, timeoutMillis);
} catch (e) {
//handle error
}
import { run } from '@dreamworld/async-tasks';
try {
const taskId = yield fork(run, taskId, fn, timeoutMillis);
yield cancel(taskId);
} catch (e) {
//handle error
}
import { taskResult } from '@dreamworld/async-tasks';
try {
const result = yield call(taskResult, taskId);
} catch (e) {
//if Task failed.
}
Task get(id)
: Returns Task of given id.String status(id)
: Returns current status of given taskIdObject result(id)
: Returns result of given taskIdIt manages state at below path.
Path: ___DW_asyncTasks.$taskId
name | data type | description |
---|---|---|
status | String | Possible values: IN_PROGRESS , SUCCESS and FAILED . |
startedAt | Number | What Task execution is started |
completedAt | Number | When Task is completed; status changed to SUCCESS or FAILED. |
result | Object | Task result. Promise resolved with this |
error | Error | String |
FAQs
It's used to manage async tasks on redux
The npm package @dreamworld/async-tasks receives a total of 55 weekly downloads. As such, @dreamworld/async-tasks popularity was classified as not popular.
We found that @dreamworld/async-tasks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
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.