File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export * from './lib/utils/attach';
16
16
export * from './lib/utils/before-render' ;
17
17
export * from './lib/utils/is' ;
18
18
export * from './lib/utils/make' ;
19
+ export * from './lib/utils/non-nullish' ;
19
20
export * from './lib/utils/object-events' ;
20
21
export * from './lib/utils/parameters' ;
21
22
export * from './lib/utils/resolve-ref' ;
Original file line number Diff line number Diff line change
1
+ import { Injector , Signal } from '@angular/core' ;
2
+ import { toObservable } from '@angular/core/rxjs-interop' ;
3
+ import { assertInjector } from 'ngxtension/assert-injector' ;
4
+ import { map } from 'rxjs' ;
5
+
6
+ export function injectNonNullish$ ( sig : Signal < unknown > , { injector } : { injector ?: Injector } = { } ) {
7
+ return assertInjector ( injectNonNullish$ , injector , ( ) => toObservable ( sig ) . pipe ( map ( ( val ) => val != null ) ) ) ;
8
+ }
You can’t perform that action at this time.
0 commit comments