Skip to content

Commit

Permalink
Add Public Init to StoreConfig (#59)
Browse files Browse the repository at this point in the history
* Tie effects lifetime to the store

* Add parameters to scope

* Fix benchmark

* Add timer demo

* Adjust title

* Add public init
  • Loading branch information
vctxr authored Oct 12, 2022
1 parent c72b3e9 commit c20800e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Sources/RxComposableArchitecture/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,19 @@ private struct Scope<RootState, RootAction>: AnyScope {
}

public struct StoreConfig {
public let useNewScope: () -> Bool
public let mainThreadChecksEnabled: () -> Bool
public let cancelsEffectsOnDeinit: () -> Bool
public var useNewScope: () -> Bool
public var mainThreadChecksEnabled: () -> Bool
public var cancelsEffectsOnDeinit: () -> Bool

public init(
useNewScope: @escaping () -> Bool,
mainThreadChecksEnabled: @escaping () -> Bool,
cancelsEffectsOnDeinit: @escaping () -> Bool
) {
self.useNewScope = useNewScope
self.mainThreadChecksEnabled = mainThreadChecksEnabled
self.cancelsEffectsOnDeinit = cancelsEffectsOnDeinit
}
}

extension StoreConfig {
Expand Down

0 comments on commit c20800e

Please sign in to comment.