Skip to content

Instantly share code, notes, and snippets.

View jokernix's full-sized avatar

Nikolay Bolotnikov jokernix

View GitHub Profile
@jokernix
jokernix / index.ts
Created November 20, 2018 12:40
Demonstrating the difference between concatMap and mergeMap and switchMap
import { of } from 'rxjs';
import { concatMap, delay, mergeMap, switchMap } from 'rxjs/operators';
const source = of(2000, 1000);
source
.pipe(concatMap(val => of(`Delayed by: ${val}ms`).pipe(delay(val))))
.subscribe(val => console.log(`With concatMap: ${val}`));
source
@jokernix
jokernix / convertModelToFormData.ts
Last active July 16, 2018 11:32
Convert Model to FormData
export function isEmpty(obj) {
if (typeof obj === 'string' || obj === '') {
return false;
}
if (typeof obj === 'number' || obj === 0) {
return false;
}
if (typeof obj === 'boolean') {
return false;
}
@jokernix
jokernix / .css
Last active October 26, 2017 11:49
animation
.sk-cube-grid .sk-cube {
width: 33%;
height: 33%;
background-color: #FFFFFF;
float: left;
-webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
animation: sk-cubeGridScaleDelay 3s infinite cubic-bezier(1, 1, 1, 0.2);
}