@lotto24-angular/defer-queue
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

Defer-Queue for Angular

Usage

App configuration

In your App config, provide the defer queue:

export const appConfig = {
  providers: [
    provideRouter(
      appRoutes,
    ),
    provideDeferQueue(),
  ],
};

Component

In your component, inject the defer queue service

@Component({...})
export class SomeComponent {
  protected readonly deferQueue = inject(DeferQueueService);
}

Template

  1. in your component's template, use the defer queue's trigger.
  2. add an identifier for this item. This improves logging, but it is also needed for the queue to work. You should also set a priority for this defer block. 3important: add the directive [deferQueueResolve] to your deferred component. The value should match the previous identifier. This will signal to the queue when the defer block is resolved.
@defer (when deferQueue.when('fruit0', 'lowest')) {
  <imports-orchestrator-examples-fruit0-component deferQueueResolve="fruit0" />
}

Package Sidebar

Install

npm i @lotto24-angular/defer-queue

Weekly Downloads

1

Version

0.4.3

License

none

Unpacked Size

145 kB

Total Files

45

Last publish

Collaborators

  • lotto24-angular