concatAll OperatorCan be imported from here:
1 2 3 import { concatAll } from 'rxjs/operators'; // or const { concatAll } = require('rxjs/operators'); For official documentation, visit https://rxjs-dev.firebaseapp.com/api/operators/concatAll
What it does?Concatenates higher order observables into first order observable in order.
Note: concatAll() is equivalent to mergeAll() with concurrency parameter equal to 1.
Example 11 2 3 4 5 6 7 8 9 10 import { fromEvent, interval } from 'rxjs'; import { map, take, concatAll } from 'rxjs/operators'; const clicks = fromEvent(document, 'click'); const triggerIntervalObservable$ = interval(500).
endWith OperatorCan be imported from here:
1 2 3 import { endWith } from 'rxjs/operators'; // or const { endWith } = require('rxjs/operators'); For official documentation, visit https://rxjs-dev.firebaseapp.com/api/operators/endWith
What it does?Returns an observable that emits after the source completes.
Example 11 2 3 4 5 6 7 import { of } from 'rxjs'; import { endWith } from 'rxjs/operators'; const source$ = of('hi', 'how are you?
Interval OperatorCan be imported from here:
1 2 3 import { interval } from 'rxjs'; // or const { interval } = require('rxjs'); For official documentation, visit https://rxjs-dev.firebaseapp.com/api/index/function/interval
What it does?Creates an observable and emits in sequence at specified interval of time.
Example 11 2 3 4 5 6 const { interval } = require('rxjs'); const interval$ = interval(1000); interval$.subscribe((value) => { console.log(value); }) Output:
Introduction to RxJsRxJs is javascript’s implementation of ReactiveX. It is a library to compose asynchronous event-based programs. It provides this feature by its core object called Observable.
Some essential concepts of RxJs:
Pull vs Push: Two different protocols of production and consumption of data. Observable: represents the idea of an invokable collection of future values or events. Observer: is a collection of callbacks that knows how to listen to values delivered by the Observable.
Map OperatorCan be imported from here:
1 2 3 import { map } from 'rxjs/operators'; // or const { map } = require('rxjs/operators'); What it does?It functions in a similar fashion to Array.prototype.map(). It receives values from passing observable and modifies it as intended in the mapping function.
Example 1 To understand interval operator, visit interval operator
1 2 3 4 5 6 7 8 const { interval } = require('rxjs'); const { map } = require('rxjs/operators'); const interval$ = interval(1000); interval$.
Setup gitlab-runner for CI/CD Note: Steps in this article follows gitlab-runner’s installation on ubuntu OS. I will be using Ubuntu 20.04.
Steps Installation of gitlab-runner Register gitlab-runner .gitlab-ci.yml examples Installation of gitlab-runner You can also follow official documentation for installation of gitlab-runner here.
Download gitlab-runner_[arch].deb1 curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_<arch>.deb Find architectures here.
Install gitgitlab-runner has dependency on git.
1 2 sudo apt-get update sudo apt-get install git -y Install gitlab-runner1 dpkg -i gitlab-runner_<arch>.