@obliczeniowo/elementary
Version:
Library made in Angular version 19
39 lines (38 loc) • 981 B
TypeScript
import { BehaviorSubject } from 'rxjs';
import { Size } from '../interfaces/size';
import * as i0 from "@angular/core";
/**
* Service that let you easy react on change of window size
*
* @example
*
* constructor(public resize: OblResizeService) { }
*
* ngOnInit(): void {
* this.subscription = this.resize.resized.subscribe((size: Size) => {
* this.resize(size);
* });
* }
*
* ngOnDestroy(): void {
* if (this.subscription && !this.subscription.closed) {
* this.subscription.unsubscribe();
* }
* }
*
* resize(size: Size): void {
* console.log(size);
* }
*/
export declare class OblResizeWindowService {
/** current window size */
size: Size;
/**
* triggered on window size change
*/
resized: BehaviorSubject<Size>;
constructor();
protected resize(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<OblResizeWindowService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<OblResizeWindowService>;
}