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

bordoley / reactive-js / 13915884845

18 Mar 2025 05:11AM UTC coverage: 95.201% (-0.1%) from 95.317%
13915884845

push

github

bordoley
streamline producer to broadcaster relationships in the api

1086 of 1236 branches covered (87.86%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 2 files covered. (100.0%)

9 existing lines in 2 files now uncovered.

6294 of 6516 relevant lines covered (96.59%)

3037.56 hits per line

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

55.56
/src/computations/EventSource/__private__/EventSource.createPauseable.ts
1
import {
12✔
2
  include,
3
  init,
4
  mixInstanceFactory,
5
  props,
6
} from "../../../__internal__/mixins.js";
7
import {
12✔
8
  EventSourceLike,
9
  StoreLike_value,
10
  WritableStoreLike,
11
} from "../../../computations.js";
12
import { Function1, none, pipe } from "../../../functions.js";
12✔
13
import DelegatingDisposableMixin from "../../../utils/__mixins__/DelegatingDisposableMixin.js";
12✔
14
import {
12✔
15
  DisposableLike,
16
  PauseableLike,
17
  PauseableLike_isPaused,
18
  PauseableLike_pause,
19
  PauseableLike_resume,
20
} from "../../../utils.js";
21
import type * as EventSource from "../../EventSource.js";
22
import * as WritableStore from "../../WritableStore.js";
12✔
23
import DelegatingEventSourceMixin from "../../__mixins__/DelegatingEventSourceMixin.js";
12✔
24

25
export const EventSource_createPauseable: EventSource.Signature["createPauseable"] =
12✔
26
  /*@__PURE__*/ (<T>() => {
27
    type TProperties = {
28
      [PauseableLike_isPaused]: WritableStoreLike<boolean>;
29
    };
30

31
    return mixInstanceFactory(
12✔
32
      include(DelegatingDisposableMixin, DelegatingEventSourceMixin()),
33
      function PauseableEventSource(
34
        this: Pick<
35
          PauseableLike,
36
          typeof PauseableLike_pause | typeof PauseableLike_resume
37
        > &
38
          TProperties,
39
        op: Function1<
40
          EventSourceLike<boolean> & DisposableLike,
41
          EventSourceLike<T>
42
        >,
43
      ): PauseableLike & EventSourceLike<T> & DisposableLike {
UNCOV
44
        const writableStore = (this[PauseableLike_isPaused] =
×
45
          WritableStore.create(true));
46

UNCOV
47
        const delegate = pipe(writableStore, op);
×
48

UNCOV
49
        init(DelegatingDisposableMixin, this, writableStore);
×
UNCOV
50
        init(DelegatingEventSourceMixin<T>(), this, delegate);
×
51

UNCOV
52
        this[PauseableLike_resume]();
×
53

UNCOV
54
        return this;
×
55
      },
56
      props<TProperties>({
57
        [PauseableLike_isPaused]: none,
58
      }),
59
      {
60
        [PauseableLike_pause](this: TProperties) {
UNCOV
61
          this[PauseableLike_isPaused][StoreLike_value] = true;
×
62
        },
63

64
        [PauseableLike_resume](this: TProperties) {
UNCOV
65
          this[PauseableLike_isPaused][StoreLike_value] = false;
×
66
        },
67
      },
68
    );
69
  })();
70

71
export default EventSource_createPauseable;
12✔
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

© 2026 Coveralls, Inc