Skip to content

Commit 0f433b8

Browse files
committed
Merge branch 'next'
2 parents f09585c + 0f13273 commit 0f433b8

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

libs/ngx-breakpoint-observer/src/lib/observe-breakpoints.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { computed, type Signal } from '@angular/core';
22
import { observeMediaQuery } from './observe-media-query';
33
import {
44
Breakpoints,
5-
defaultWindow,
65
MaybeSignalOrGetter,
76
ObserveBreakpointsOptions,
87
} from './types';
9-
import { increaseWithUnit } from './utils/increase-with-unit';
10-
import { toValue } from './utils/to-value';
8+
import { defaultWindow, increaseWithUnit, toValue } from './utils';
119

1210
/**
1311
* Reactive viewport breakpoints

libs/ngx-breakpoint-observer/src/lib/observe-media-query.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { effect, type Signal, signal, untracked } from '@angular/core';
2-
import {
3-
ConfigurableWindow,
4-
defaultWindow,
5-
MaybeSignalOrGetter,
6-
} from './types';
7-
import { toValue } from './utils/to-value';
2+
import { ConfigurableWindow, MaybeSignalOrGetter } from './types';
3+
import { defaultWindow, toValue } from './utils';
84

95
/**
106
* Reactive Media Query.

libs/ngx-breakpoint-observer/src/lib/types.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import { Signal } from '@angular/core';
22

33
export type Breakpoints<K extends string = string> = Record<K, number | string>;
44

5+
/**
6+
* Maybe it's a signal, or a plain value, or a getter function
7+
*/
58
export type MaybeSignalOrGetter<T> = T | Signal<T> | (() => T);
69

710
export interface ConfigurableWindow {
8-
/*
11+
/**
912
* Specify a custom `window` instance, e.g. working with iframes or in testing environments.
1013
*/
1114
window?: Window;
@@ -22,7 +25,3 @@ export interface ObserveBreakpointsOptions extends ConfigurableWindow {
2225
*/
2326
strategy?: 'min-width' | 'max-width';
2427
}
25-
26-
export const isClient =
27-
typeof window !== 'undefined' && typeof document !== 'undefined';
28-
export const defaultWindow = isClient ? window : undefined;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './increase-with-unit';
2+
export * from './to-value';
3+
export * from './utils';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const isClient =
2+
typeof window !== 'undefined' && typeof document !== 'undefined';
3+
export const defaultWindow = isClient ? window : undefined;

0 commit comments

Comments
 (0)