Skip to content

Commit 4ecfbdb

Browse files
committed
Add a shouter type for easier testing
1 parent ddc544b commit 4ecfbdb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/Shouter/Shouter.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88

99
import Foundation
1010

11-
public class Shouter {
11+
public protocol ShouterType {
12+
func register<T>(_ type: T.Type, observer: T)
13+
func unregister<T>(_ type: T.Type, observer: T)
14+
func unregister<T>(_ type: T.Type)
15+
func notify<T>(_ type: T.Type, block: (T) -> Void)
16+
}
17+
18+
public class Shouter: ShouterType {
1219

1320
public static let `default` = Shouter()
1421

0 commit comments

Comments
 (0)