• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atinc / ngx-tethys / 16c04211-96d9-4801-9a77-7aba7f7b00c3

14 Nov 2024 03:47AM UTC coverage: 90.323% (-0.07%) from 90.395%
16c04211-96d9-4801-9a77-7aba7f7b00c3

Pull #3229

circleci

minlovehua
feat(watermark): support dark theme for watermark component #TINFR-501 
Pull Request #3229: feat(watermark): support dark theme for watermark component #TINFR-501

5511 of 6750 branches covered (81.64%)

Branch coverage included in aggregate %.

40 of 48 new or added lines in 3 files covered. (83.33%)

3 existing lines in 1 file now uncovered.

13176 of 13939 relevant lines covered (94.53%)

997.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.89
/src/core/theme/utils.ts
1
import { MutationObserverFactory } from '@angular/cdk/observers';
2
import { DestroyRef } from '@angular/core';
3
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
import { Observable, Subject } from 'rxjs';
5

6✔
6
export function observeTheme(
6✔
7
    observer: MutationObserver,
6✔
8
    destroyRef: DestroyRef,
6✔
9
    themeChangedCallback: Function
6!
10
): Observable<Subject<MutationRecord[]>> {
6✔
11
    observer?.disconnect();
12
    return new Observable(observe => {
13
        const stream = new Subject<MutationRecord[]>();
14
        observer = new MutationObserverFactory().create(mutations => stream.next(mutations));
15
        if (observer) {
6✔
NEW
16
            observer.observe(document.documentElement, {
×
NEW
17
                attributes: true,
×
NEW
18
                attributeFilter: ['theme']
×
19
            });
20
        }
21
        stream.pipe(takeUntilDestroyed(destroyRef)).subscribe(mutations => {
22
            for (const mutation of mutations) {
6✔
23
                if (mutation.type === 'attributes' && mutation.attributeName === 'theme') {
6✔
24
                    themeChangedCallback();
6✔
25
                }
26
            }
27
        });
28
        observe.next(stream);
29
        return () => {
30
            observer?.disconnect();
31
        };
32
    });
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc