ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
39 lines (34 loc) • 1.33 kB
JavaScript
import { InjectionToken, inject, Injector, afterNextRender } from '@angular/core';
import { Observable } from 'rxjs';
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* An injection token representing `afterNextRender` as an observable rather
* than a callback-based API has been added. This might be necessary in code
* where streams of data are already being used and we need to wait until
* the change detection ends before performing any tasks.
*/
const NZ_AFTER_NEXT_RENDER$ = new InjectionToken('nz-after-next-render', {
providedIn: 'root',
factory: () => {
const injector = inject(Injector);
return new Observable(subscriber => {
const ref = afterNextRender(() => {
subscriber.next();
subscriber.complete();
}, { injector });
return () => ref.destroy();
});
}
});
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* Generated bundle index. Do not edit.
*/
export { NZ_AFTER_NEXT_RENDER$ };
//# sourceMappingURL=ng-zorro-antd-core-render.mjs.map