MCPcopy
hub / github.com/rx-angular/rx-angular / RxPush

Class RxPush

libs/template/push/src/lib/push.pipe.ts:90–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 */
89@Pipe({ name: 'push', pure: false, standalone: true })
90export class RxPush implements PipeTransform, OnDestroy {
91 /** @internal */
92 private strategyProvider = inject(RxStrategyProvider);
93 /** @internal */
94 private ngZone = inject(NgZone);
95 /**
96 * @internal
97 * This is typed as `any` because the type cannot be inferred
98 * without a class-level generic argument, which was removed to
99 * fix https://github.com/rx-angular/rx-angular/pull/684
100 */
101 private renderedValue: any | null | undefined;
102 /** @internal */
103 private subscription: Unsubscribable;
104 /** @internal */
105 private readonly templateObserver = createTemplateNotifier<any>();
106 private readonly templateValues$ = this.templateObserver.values$.pipe(
107 onlyValues(),
108 shareReplay({ bufferSize: 1, refCount: true })
109 );
110 /** @internal */
111 private readonly strategyHandler = strategyHandling(
112 this.strategyProvider.primaryStrategy,
113 this.strategyProvider.strategies
114 );
115 /** @internal */
116 private patchZone: false | NgZone;
117 /** @internal */
118 private _renderCallback: NextObserver<any>;
119
120 constructor(private cdRef: ChangeDetectorRef) {}
121
122 transform<U>(
123 potentialObservable: null,
124 config?: RxStrategyNames | Observable<RxStrategyNames>,
125 renderCallback?: NextObserver<U>
126 ): null;
127 transform<U>(
128 potentialObservable: undefined,
129 config?: RxStrategyNames | Observable<RxStrategyNames>,
130 renderCallback?: NextObserver<U>
131 ): undefined;
132 transform<U>(
133 potentialObservable: ObservableInput<U> | U,
134 config?: RxStrategyNames | Observable<RxStrategyNames>,
135 renderCallback?: NextObserver<U>
136 ): U;
137 transform<U>(
138 potentialObservable: ObservableInput<U>,
139 config?: PushInput<U>
140 ): U;
141 transform<U>(
142 potentialObservable: ObservableInput<U> | U | null | undefined,
143 config:
144 | PushInput<U>
145 | RxStrategyNames
146 | Observable<RxStrategyNames>
147 | undefined,

Callers

nothing calls this directly

Calls 3

createTemplateNotifierFunction · 0.90
strategyHandlingFunction · 0.90
onlyValuesFunction · 0.85

Tested by

no test coverage detected