Skip to content

Commit

Permalink
refactor: rename a parent domain param
Browse files Browse the repository at this point in the history
  • Loading branch information
r13v committed Jul 13, 2023
1 parent 65fa6f6 commit 2cdfc62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Effector/Domain.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
public class Domain {
// MARK: Lifecycle

public init(_ name: String, domain: Domain? = nil) {
public init(_ name: String, parent: Domain? = nil) {
self.name = name
self.parent = domain
self.parent = parent

self.graphite = Node(name: name, kind: .domain, priority: .child)

if let domain {
forward(from: eventCreated, to: domain.eventCreated)
forward(from: storeCreated, to: domain.storeCreated)
forward(from: domainCreated, to: domain.domainCreated)
if let parent {
forward(from: eventCreated, to: parent.eventCreated)
forward(from: storeCreated, to: parent.storeCreated)
forward(from: domainCreated, to: parent.domainCreated)
}

eventCreated.watch { unit in
Expand Down
2 changes: 1 addition & 1 deletion Tests/EffectorTests/DomainTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class DomainTests: XCTestCase {

func testSubdomain() async throws {
let app = Domain("app")
let domain = Domain("sub", domain: app)
let domain = Domain("sub", parent: app)

var log = [Int]()

Expand Down

0 comments on commit 2cdfc62

Please sign in to comment.