Skip to content

Installation & Setup

ngx-task provides controlled asynchronous actions for Angular v16+ powered by Angular Signals.

Installation

Install the package via npm, pnpm, or yarn:

Terminal window
npm install ngx-task
Terminal window
pnpm add ngx-task
Terminal window
yarn add ngx-task

Peer Dependencies

ngx-task requires Angular v16+ (v17 or v18+ recommended) and RxJS:

DependencyRequired Version
@angular/core>=16.0.0
rxjs>=7.5.0
typescript>=5.0.0

Package Entry Points

The package is organized into modular entry points to optimize bundle size and tree-shaking:

// 1. Core Primitives & Signals
import { createTask, Task, TaskExecution } from 'ngx-task';
// 2. Angular Template Directives (Optional)
import { TaskTriggerDirective, TaskDisableWhilePendingDirective, TaskBusyDirective } from 'ngx-task/directives';
// 3. Unit & Integration Testing Utilities
import { createTaskHarness, createControlledTaskHandler, createTaskTestClock } from 'ngx-task/testing';

Angular Compatibility Matrix

Angular Versionngx-task VersionSignal SupportZoneless Support
Angular 18+^0.1.0Native✅ Native
Angular 17^0.1.0Native✅ Native
Angular 16^0.1.0Developer Preview⚠️ Experimental