Skip to content

Commit

Permalink
feat: get rid of domain support
Browse files Browse the repository at this point in the history
  • Loading branch information
r13v committed Aug 3, 2023
1 parent 6088d20 commit e653263
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 128 deletions.
51 changes: 0 additions & 51 deletions Effector/Domain.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Effector/Effect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class Effect<Params, Done, Fail: Error>: Unit {
// MARK: Lifecycle

// swiftlint:disable:next function_body_length
public init(name: String = "effect", isDerived: Bool = false, domain: Domain? = nil, _ handler: @escaping Handler) {
public init(name: String = "effect", isDerived: Bool = false, _ handler: @escaping Handler) {
self.name = name
self.isDerived = isDerived
graphite = Node(name: name, kind: .effect, priority: .effect)
Expand Down
6 changes: 2 additions & 4 deletions Effector/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ public typealias AnyEvent = Event<Any>
public final class Event<Payload>: Unit {
// MARK: Lifecycle

public init(name: String = "event", isDerived: Bool = false, domain: Domain? = nil) {
public init(name: String = "event", isDerived: Bool = false) {
self.name = name
graphite = Node(name: name, kind: .event, priority: .child)
self.isDerived = isDerived

if let domain {
domain.eventCreated(cast())
}

}

// MARK: Public
Expand Down
6 changes: 1 addition & 5 deletions Effector/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public typealias AnyStore = Store<Any>
public final class Store<State>: Unit, ObservableObject {
// MARK: Lifecycle

public init(name: String = "store", _ defaultState: State, isDerived: Bool = false, domain: Domain? = nil) {
public init(name: String = "store", _ defaultState: State, isDerived: Bool = false) {
self.name = name
self.defaultState = defaultState
currentState = defaultState
Expand Down Expand Up @@ -41,10 +41,6 @@ public final class Store<State>: Unit, ObservableObject {
if !isDerived {
reset(reinit)
}

if let domain = domain {
domain.storeCreated(cast())
}
}

// MARK: Public
Expand Down
67 changes: 0 additions & 67 deletions Tests/EffectorTests/DomainTests.swift

This file was deleted.

0 comments on commit e653263

Please sign in to comment.