Add basic protocols and type aliases

This commit is contained in:
Matěj Kašpar Jirásek 2019-07-02 13:02:08 +02:00
parent af62d8c1c2
commit a0adfcf4ba
No known key found for this signature in database
GPG Key ID: 698F0214DB5CB3A5
8 changed files with 15 additions and 15 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/.build
/Packages
/*.xcodeproj
.swiftpm

View File

@ -1,26 +1,17 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "Elementary",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Elementary",
targets: ["Elementary"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Elementary",
dependencies: []),
name: "Elementary"),
.testTarget(
name: "ElementaryTests",
dependencies: ["Elementary"]),

View File

@ -0,0 +1,2 @@
protocol Action {}

View File

@ -0,0 +1,3 @@
typealias Call = () -> Void
typealias Dispatch = (Action) -> Call

View File

@ -1,3 +0,0 @@
struct Elementary {
var text = "Hello, World!"
}

View File

@ -0,0 +1,4 @@
protocol Store {
func dispatch(_ action: Action) -> Call
}

View File

@ -0,0 +1,2 @@
typealias Update<State> = (State, Action) -> State

View File

@ -6,7 +6,7 @@ final class ElementaryTests: XCTestCase {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(Elementary().text, "Hello, World!")
//XCTAssertEqual(Elementary().text, "Hello, World!")
}
static var allTests = [