13.2.1 • Published 2 years ago

@ngx-toolkit/utils v13.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

npm version MIT License Build Status Coverage Join the chat at https://gitter.im/ngx-toolkit/Lobby

@ngx-toolkit/utils

Angular common utilities

Table of contents:


Installation

Install the npm package.

# To get the latest stable version and update package.json file:
npm install @ngx-toolkit/utils --save
# or
yarn add @ngx-toolkit/utils

Queue

Queue annotation:

import { Queue } from '@ngx-toolkit/utils';
...

class MyComponent {
  /**
   * Put the method call in a queue and wait for a Promise / Subscription / method execution
   * /!\ the method result is modified => Return a Promise
   * @param {number} queue limit (default: no limit)
   * @param {string} queue name (default: method name)
   */
  @Queue(limit?: number, name?: string)
  method(): Promise | Subscription | any | void;
}

Wait

Wait annotation (shortcut of @Queue(1)):

import { Wait } from '@ngx-toolkit/utils';
...

class MyComponent {
  /**
   * Wait for a Promise / Subscription before to be re-executed
   * /!\ the method result is modified => Return a Promise
   * @param {string} wait name (default: method name)
   */
  @Wait(name?: string)
  method(): Promise | Subscription | any | void;
}

Once

Once annotation:

import { Once } from '@ngx-toolkit/utils';
...

class MyComponent {
  /**
   * mark a method to be executed no more than once even if called several times
   * @param {string} name (default: method name)
   */
  @Once(name?: string)
  method(): Promise | Subscription | any | void;
}

License

© 2018 Dewizz

MIT

13.2.0

2 years ago

13.2.1

2 years ago

9.0.4

4 years ago

9.0.3

4 years ago

9.0.2

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.0

5 years ago

7.0.4

5 years ago

7.0.3

5 years ago

7.0.2

5 years ago

7.0.1

5 years ago

7.0.0

6 years ago

6.1.1

6 years ago

6.1.0

6 years ago