File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
CountdownFlimClutter/ViewModels Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,14 @@ class FilmClutterViewModel: ObservableObject {
9
9
func start( ) {
10
10
reset ( )
11
11
12
- let just = Just ( ( ) )
13
- . tryMap { _ in }
14
- . eraseToAnyPublisher ( )
15
-
16
- let timer = Timer . publish ( every: time, on: . main, in: . common)
12
+ let timer : AnyPublisher < Void , Never > = Timer
13
+ . publish ( every: time, on: . main, in: . common)
17
14
. autoconnect ( )
18
- . tryMap { _ in }
15
+ . map { _ in }
16
+ . catch { _ in Empty ( ) }
19
17
. eraseToAnyPublisher ( )
20
18
21
- timerCancellable = Publishers . Merge ( just , timer)
19
+ timerCancellable = Publishers . Merge ( Just ( ( ) ) , timer)
22
20
. sink { [ weak self] in self ? . changeValue ( ) }
23
21
}
24
22
@@ -57,10 +55,10 @@ class FilmClutterViewModel: ObservableObject {
57
55
58
56
}
59
57
60
- private extension Publisher {
61
-
62
- func sink( receiveValue: @escaping ( ( Self . Output ) -> Void ) ) -> AnyCancellable {
63
- self . sink ( receiveCompletion: { _ in } , receiveValue: receiveValue)
64
- }
65
-
66
- }
58
+ // private extension Publisher {
59
+ //
60
+ // func sink(receiveValue: @escaping ((Self.Output) -> Void)) -> AnyCancellable {
61
+ // self.sink(receiveCompletion: { _ in }, receiveValue: receiveValue)
62
+ // }
63
+ //
64
+ // }
You can’t perform that action at this time.
0 commit comments