Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
MINTRUN = mint run
DOCC_TARGET = SimplexArchitecture
DOCC_DIR = ./docs

.PHONY: bootstrap
format:
Expand All @@ -15,3 +17,16 @@ test:
.PHONY: benchmark
benchmark:
swift run --configuration release swiftui-simplex-architecture-benchmark

.PHONY: docc
docc:
swift package --allow-writing-to-directory $(DOCC_DIR) \
generate-documentation --target $(DOCC_TARGET) \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path swiftui-simplex-architecture \
--output-path $(DOCC_DIR)

.PHONY: docc-preview
docc-preview:
swift package --disable-sandbox preview-documentation --target $(DOCC_TARGET)
18 changes: 18 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swiftui-navigation.git", exact: "1.0.2"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", exact: "0.1.0"),
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SimplexArchitecture/ActionSendable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public extension ActionSendable {
}

@inline(__always)
func threadCheck() {
private func threadCheck() {
#if DEBUG
guard !Thread.isMainThread else {
return
Expand Down
4 changes: 2 additions & 2 deletions Sources/SimplexArchitecture/Macros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// It is conformed to the `ActionSendable` protocol by the `ViewState` macro.
///
/// Here is a example code.
/// ```
/// ```Swift
/// @ViewState
/// struct MyView: View {
/// let store: Store<MyReducer> = Store(reducer: MyReducer())
Expand All @@ -30,7 +30,7 @@
/// }
/// ```
/// Here is a sample code if you want to use ReducerState.
/// ```
/// ```Swift
/// @ViewState
/// struct MyView: View {
/// let store: Store<MyReducer>
Expand Down
4 changes: 2 additions & 2 deletions Sources/SimplexArchitecture/Reducer/ReducerProtocol.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// A protocol that defines a reducer for a target type.
///
/// ```
/// ```Swift
/// @Reducer
/// struct MyReducer {
/// enum ViewAction {
Expand Down Expand Up @@ -41,7 +41,7 @@
/// ```
/// Also, `ReducerState` is useful to reduce unnecessary View updates. View is not updated when `ReducerState` changes. It can be used only with `Reducer`.
///
/// ```
/// ```Swift
/// @Reducer
/// struct MyReducer {
/// enum ViewAction {
Expand Down
3 changes: 3 additions & 0 deletions Sources/SimplexArchitecture/StateContainer.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Foundation
import XCTestDynamicOverlay

/// Container that holds the reducer state and state for a given target conforming to `ActionSendable`.
///
/// StateContainer is not thread-safe. StateContainer must be accessed from MainActor.
@dynamicMemberLookup
public final class StateContainer<Target: ActionSendable> {
/// Instance of ReducerState
public var reducerState: Target.Reducer.ReducerState {
_read { yield _reducerState! }
_modify { yield &_reducerState! }
Expand Down
9 changes: 9 additions & 0 deletions docs/css/chunk-c0335d80.10a2f091.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/css/documentation-topic.1d1eec04.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/css/documentation-topic~topic.b6287bcf.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/css/index.038e887c.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/css/topic.d8c126f3.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/css/tutorials-overview.c249c765.css

Large diffs are not rendered by default.

Loading