This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injector, NgModule, ɵComponentDef as ComponentDef, ɵNG_COMP_DEF } from '@angular/core'; | |
import { LayoutType } from '@constants/layout'; | |
import { GlobalLayoutStore } from '@services/store/global-layout.store'; | |
const NG_COMP_DEF = ɵNG_COMP_DEF as 'ɵcmp'; | |
interface Options { | |
layout?: LayoutType; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function Required(target: { [prop: string]: any }, propertyKey: string) { | |
Object.defineProperty(target, propertyKey, { | |
get() { | |
throw new Error(`Attribute ${propertyKey} is required`); | |
}, | |
set(value) { | |
Object.defineProperty( | |
target, | |
propertyKey, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ellipsis { | |
position: relative; | |
} | |
.ellipsis:before { | |
content: ' '; | |
visibility: hidden; | |
} | |
.ellipsis span { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debounceTime<T extends (...args: any) => any>(callback: T, time: number) { | |
let timeout: NodeJS.Timeout | null = null; | |
return (...args: Parameters<T>) => { | |
timeout != null && clearTimeout(timeout); | |
timeout = setTimeout( | |
() => { | |
timeout = null; | |
callback.apply(null, args); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sv-numbers-range> | |
<input svThreshold placeholder="Min price" formControlName="min" type="text"> | |
<input svThreshold placeholder="Max price" formControlName="max" type="text"> | |
</sv-numbers-range> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Modify<T, R extends { [key in keyof T]?: any }> = Omit<T, keyof R> & R; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable, ReplaySubject } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class EventBusService { | |
private readonly events: { [eventName: string]: ReplaySubject<any> } = {}; | |
public sub(event: string): Observable<any> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; | |
import { timer, Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; | |
@Component({ | |
selector: 'app-clock', | |
template: `{{ time$ | async | date:'medium' }}`, | |
encapsulation: ViewEncapsulation.None, | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"package": "npm:[email protected]", | |
"package-1.5": "npm:[email protected]", | |
"package-1.6": "npm:[email protected]", | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
class Animal {} | |
class Dog extends Animal { | |
bark() {} | |
} | |
class Cat extends Animal { | |
meow() {} | |
} |