diff --git a/MobiusCore/Source/ConcurrentAccessDetector.swift b/MobiusCore/Source/ConcurrentAccessDetector.swift index acc5edb6..b37026b2 100644 --- a/MobiusCore/Source/ConcurrentAccessDetector.swift +++ b/MobiusCore/Source/ConcurrentAccessDetector.swift @@ -22,7 +22,7 @@ import Foundation /// Utility to catch invalid concurrent access to non-thread-safe code. /// /// Like a mutex, `ConcurrentAccessDetector` guards a critical region. However, instead of blocking if two threads -/// attemt to enter the critical region at once, it crashes in debug builds. In release builds, it has no effect (and +/// attempt to enter the critical region at once, it crashes in debug builds. In release builds, it has no effect (and /// also no overhead, as long as it’s only used within one module). /// /// Copies of a `ConcurrentAccessDetector` share the same underlying mutex, and hence their critical region is the union diff --git a/MobiusCore/Source/Disposables/CompositeDisposable.swift b/MobiusCore/Source/Disposables/CompositeDisposable.swift index 47610103..867571d5 100644 --- a/MobiusCore/Source/Disposables/CompositeDisposable.swift +++ b/MobiusCore/Source/Disposables/CompositeDisposable.swift @@ -25,7 +25,7 @@ public final class CompositeDisposable { private var disposables: [Disposable] private let lock = DispatchQueue(label: "Mobius.CompositeDisposable") - /// Initialises a `CompositeDisposable`. + /// Initializes a `CompositeDisposable`. /// /// - Parameter disposables: an array of disposables. init(disposables: [Disposable]) { diff --git a/MobiusCore/Source/Disposables/Disposable.swift b/MobiusCore/Source/Disposables/Disposable.swift index 19eea2fd..c5a17963 100644 --- a/MobiusCore/Source/Disposables/Disposable.swift +++ b/MobiusCore/Source/Disposables/Disposable.swift @@ -19,7 +19,7 @@ /// Types adopting the `Disposable` protocol can be disposed, cleaning up the resources referenced. /// -/// The resouces can be anything; ranging from a network request, task on the CPU or an observation of another resource. +/// The resources can be anything; ranging from a network request, task on the CPU or an observation of another resource. /// /// See also `AnonymousDisposable` for a concrete anonymous implementation. public protocol Disposable: AnyObject { diff --git a/MobiusCore/Source/MobiusController.swift b/MobiusCore/Source/MobiusController.swift index 67353d1a..09c31a5e 100644 --- a/MobiusCore/Source/MobiusController.swift +++ b/MobiusCore/Source/MobiusController.swift @@ -82,7 +82,7 @@ public final class MobiusController { ┃ loopQueue ┃ ┗━━━━━━━━━━━┛ - In order to construct this bottom-up and fulfil definitive initialization requirements, state and loopQueue are + In order to construct this bottom-up and fulfill definitive initialization requirements, state and loopQueue are duplicated in local variables. */ diff --git a/MobiusCore/Source/MobiusLoop.swift b/MobiusCore/Source/MobiusLoop.swift index dd2c69c3..ce0e84f6 100644 --- a/MobiusCore/Source/MobiusLoop.swift +++ b/MobiusCore/Source/MobiusLoop.swift @@ -148,7 +148,7 @@ public final class MobiusLoop: Disposable { consumeEvent(event) } - // MARK: - Implemenation details + // MARK: - Implementation details /// Apply a `Next`: /// diff --git a/MobiusCore/Source/WorkBag.swift b/MobiusCore/Source/WorkBag.swift index cc3fb397..a8277c92 100644 --- a/MobiusCore/Source/WorkBag.swift +++ b/MobiusCore/Source/WorkBag.swift @@ -19,7 +19,7 @@ import Foundation -/// Like a work queue, but agressively avoids doing things sequentially. +/// Like a work queue, but aggressively avoids doing things sequentially. /// /// We don’t want to commit to any sequencing guarantees in Mobius loops. Since we’re cognizant of Hyrum’s Law, we don’t /// want to provide _unguaranteed_ sequencing either, so this implementation currently randomizes execution order. We diff --git a/MobiusCore/Test/AnyConnectionTests.swift b/MobiusCore/Test/AnyConnectionTests.swift index 7a2d5b5c..80fefce9 100644 --- a/MobiusCore/Test/AnyConnectionTests.swift +++ b/MobiusCore/Test/AnyConnectionTests.swift @@ -24,7 +24,7 @@ import Quick class ConnectionTests: QuickSpec { override func spec() { describe("Connection") { - context("when initialising with closures") { + context("when initializing with closures") { var connection: Connection! var acceptValue: Int? var disposeCalled = false diff --git a/MobiusCore/Test/CompositeDisposableTests.swift b/MobiusCore/Test/CompositeDisposableTests.swift index 39f788f2..17e729b3 100644 --- a/MobiusCore/Test/CompositeDisposableTests.swift +++ b/MobiusCore/Test/CompositeDisposableTests.swift @@ -64,7 +64,7 @@ class CompositeDisposableTests: QuickSpec { disposables[1] = five disposables[2] = six } - it("doesnt dispose last") { + it("doesn’t dispose last") { composite.dispose() expect(one.disposed).to(beTrue()) expect(two.disposed).to(beTrue()) diff --git a/MobiusCore/Test/MobiusControllerTests.swift b/MobiusCore/Test/MobiusControllerTests.swift index f42b0543..1f4250e8 100644 --- a/MobiusCore/Test/MobiusControllerTests.swift +++ b/MobiusCore/Test/MobiusControllerTests.swift @@ -39,7 +39,7 @@ class MobiusControllerTests: QuickSpec { var activateInitiator: Bool! func clearViewRecorder() { - makeSureAllEffectsAndEventsHaveBeenProccessed() + makeSureAllEffectsAndEventsHaveBeenProcessed() view.recorder.clear() } @@ -107,13 +107,13 @@ class MobiusControllerTests: QuickSpec { controller.start() view.dispatch("restarted") - self.makeSureAllEffectsAndEventsHaveBeenProccessed() + self.makeSureAllEffectsAndEventsHaveBeenProcessed() expect(view.recorder.items).toEventually(equal(["S", "S-restarted"])) } it("should retain updated state") { view.dispatch("hi") - self.makeSureAllEffectsAndEventsHaveBeenProccessed() + self.makeSureAllEffectsAndEventsHaveBeenProcessed() controller.stop() @@ -318,7 +318,7 @@ class MobiusControllerTests: QuickSpec { controller.start() view.dispatch("the last event") - self.makeSureAllEffectsAndEventsHaveBeenProccessed() + self.makeSureAllEffectsAndEventsHaveBeenProcessed() controller.stop() @@ -380,7 +380,7 @@ class MobiusControllerTests: QuickSpec { } it("should release any references to the loop") { - self.makeSureAllEffectsAndEventsHaveBeenProccessed() + self.makeSureAllEffectsAndEventsHaveBeenProcessed() controller.stop() controller.disconnectView() controller = nil @@ -390,7 +390,7 @@ class MobiusControllerTests: QuickSpec { } } - func makeSureAllEffectsAndEventsHaveBeenProccessed() { + func makeSureAllEffectsAndEventsHaveBeenProcessed() { loopQueue.sync { // Waiting synchronously for effects to be completed } diff --git a/MobiusCore/Test/MobiusLoopTests.swift b/MobiusCore/Test/MobiusLoopTests.swift index 8f39b810..02773382 100644 --- a/MobiusCore/Test/MobiusLoopTests.swift +++ b/MobiusCore/Test/MobiusLoopTests.swift @@ -94,7 +94,7 @@ class MobiusLoopTests: QuickSpec { expect(receivedModels).to(equal(["the beginning", "one", "two", "three"])) } - it("should queue up events dispatched before start to support racy initialisations") { + it("should queue up events dispatched before start to support racy initializations") { loop = Mobius.loop(update: Update { model, event in .next(model + "-" + event) }, effectHandler: EagerEffectHandler()) .start(from: "the beginning") @@ -175,7 +175,7 @@ class MobiusLoopTests: QuickSpec { } describe("when creating a builder") { - context("when a class corresponding to the ConnectableProtocol is used as effecthandler") { + context("when a class corresponding to the ConnectableProtocol is used as effect handler") { beforeEach { let update = Update { (_: String, _: String) -> Next in Next.noChange diff --git a/MobiusExtras/Source/ConnectableClass.swift b/MobiusExtras/Source/ConnectableClass.swift index afe90c8f..e6b2b822 100644 --- a/MobiusExtras/Source/ConnectableClass.swift +++ b/MobiusExtras/Source/ConnectableClass.swift @@ -99,7 +99,7 @@ open class ConnectableClass: Connectable { private func accept(_ input: Input) { // The construct of consumerSet is there to release the lock asap. - // We dont know what goes on in the overriden `handle` function... + // We don’t know what goes on in the overridden `handle` function... var consumerSet: Bool = false lock.lock() consumerSet = consumer != nil