Skip to content

Commit

Permalink
Convert MainComponent to ValueType before passing arround
Browse files Browse the repository at this point in the history
  • Loading branch information
congncif committed Oct 1, 2021
1 parent af0073a commit 44d1944
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Boardy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Boardy"
s.version = "1.34.0"
s.version = "1.34.1"
s.swift_versions = ["5.3", "5.4", "5.5"]
s.summary = "A mediator interface to integrate multiple mobile architectures."

Expand Down
7 changes: 4 additions & 3 deletions Boardy/ModulePlugin/PluginLauncher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class LauncherComponent {
}

func loadPluginsIfNeeded() {
plugins.forEach { $0.apply(for: self) }
plugins.forEach { $0.apply(for: Component(options: options, producer: container.boxed)) }
plugins.removeAll()
}

Expand All @@ -63,8 +63,9 @@ public final class LauncherComponent {
}
}

extension LauncherComponent: MainComponent {
public var producer: BoardDynamicProducer { container.boxed }
struct Component: MainComponent {
let options: MainOptions
let producer: BoardDynamicProducer
}

public final class PluginLauncher {
Expand Down
4 changes: 4 additions & 0 deletions Example/Boardy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
27547FCE25415640005C9027 /* HeadlineBoard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27547FCD25415640005C9027 /* HeadlineBoard.swift */; };
27547FD22541571C005C9027 /* FeaturedBoard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27547FD12541571C005C9027 /* FeaturedBoard.swift */; };
2766A4652706B22300C04DA9 /* ProducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2766A4642706B22300C04DA9 /* ProducerTests.swift */; };
2766A4672706ED7200C04DA9 /* PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2766A4662706ED7200C04DA9 /* PluginTests.swift */; };
2776F43126DD0F4900680B7F /* TaskBoardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776F43026DD0F4900680B7F /* TaskBoardTests.swift */; };
277BC12926D9EEF400BDEA8F /* AdapterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277BC12826D9EEF400BDEA8F /* AdapterTests.swift */; };
277BC12B26D9F75C00BDEA8F /* InteractableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277BC12A26D9F75C00BDEA8F /* InteractableTests.swift */; };
Expand Down Expand Up @@ -102,6 +103,7 @@
27547FCD25415640005C9027 /* HeadlineBoard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBoard.swift; sourceTree = "<group>"; };
27547FD12541571C005C9027 /* FeaturedBoard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedBoard.swift; sourceTree = "<group>"; };
2766A4642706B22300C04DA9 /* ProducerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProducerTests.swift; sourceTree = "<group>"; };
2766A4662706ED7200C04DA9 /* PluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginTests.swift; sourceTree = "<group>"; };
2776F43026DD0F4900680B7F /* TaskBoardTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskBoardTests.swift; sourceTree = "<group>"; };
277BC12826D9EEF400BDEA8F /* AdapterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdapterTests.swift; sourceTree = "<group>"; };
277BC12A26D9F75C00BDEA8F /* InteractableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InteractableTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -456,6 +458,7 @@
2776F43026DD0F4900680B7F /* TaskBoardTests.swift */,
27F4F05726E499ED005BAC34 /* ResultBoardTests.swift */,
2766A4642706B22300C04DA9 /* ProducerTests.swift */,
2766A4662706ED7200C04DA9 /* PluginTests.swift */,
607FACE91AFB9204008FA782 /* Supporting Files */,
);
path = Tests;
Expand Down Expand Up @@ -752,6 +755,7 @@
files = (
27E40B9226CF533D00A0F634 /* BlockTaskTests.swift in Sources */,
2766A4652706B22300C04DA9 /* ProducerTests.swift in Sources */,
2766A4672706ED7200C04DA9 /* PluginTests.swift in Sources */,
270351C125C2BD26007AF693 /* AttachableTests.swift in Sources */,
27F4F05826E499ED005BAC34 /* ResultBoardTests.swift in Sources */,
27058AE026DA4281008FB4F6 /* BarrierTests.swift in Sources */,
Expand Down
24 changes: 24 additions & 0 deletions Example/Tests/PluginTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// PluginTests.swift
// Boardy_Tests
//
// Created by NGUYEN CHI CONG on 10/1/21.
// Copyright © 2021 [iF] Solution. All rights reserved.
//

@testable import Boardy
import XCTest

class PluginTests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {

}
}

0 comments on commit 44d1944

Please sign in to comment.