Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Workflow Templates #100

Merged
merged 4 commits into from
Oct 5, 2021
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// ___FILEHEADER___

import ReactiveSwift
import Workflow
import WorkflowReactiveSwift
import WorkflowUI

// MARK: Input and Output
Expand Down Expand Up @@ -37,22 +35,6 @@ extension ___VARIABLE_productName___Workflow {
}
}

// MARK: Workers

extension ___VARIABLE_productName___Workflow {
struct ___VARIABLE_productName___Worker: Worker {
enum Output {}

func run() -> SignalProducer<Output, Never> {
fatalError()
}

func isEquivalent(to otherWorker: ___VARIABLE_productName___Worker) -> Bool {
return true
}
}
}

// MARK: Rendering

extension ___VARIABLE_productName___Workflow {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,52 @@
<key>Name</key>
<string>Name:</string>
<key>Description</key>
<string>The name of the workflow to create. "Workflow" will be appended to the name.</string>
<string>The name of the workflow to create. &quot;Workflow&quot; will be appended to the name.</string>
<key>Type</key>
<string>text</string>
<key>Default</key>
<string>HelloWorld</string>
</dict>
<dict>
<key>Identifier</key>
<string>generateWorker</string>
<key>Required</key>
<true/>
<key>Name</key>
<string>Also create a Worker</string>
<key>Description</key>
<string>Workers define a unit of asynchronous work</string>
<key>Type</key>
<string>checkbox</string>
<key>Default</key>
<string>false</string>
</dict>
<dict>
<key>Identifier</key>
<string>streamType</string>
<key>Required</key>
<true/>
<key>Name</key>
<string>Uses:</string>
<key>Description</key>
<string>Whether to use RxSwift or ReactiveSwift</string>
<key>Type</key>
<string>popup</string>
<key>Default</key>
<string>ReactiveSwift</string>
<key>RequiredOptions</key>
<dict>
<key>generateWorker</key>
<array>
<string>true</string>
</array>
</dict>
<key>Values</key>
<array>
<string>RxSwift</string>
<string>ReactiveSwift</string>
</array>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ___FILEHEADER___

import ReactiveSwift
import Workflow
import WorkflowReactiveSwift
import WorkflowUI

// MARK: Workers

extension ___VARIABLE_productName___Workflow {
struct ___VARIABLE_productName___Worker: Worker {
enum Output {}

func run() -> SignalProducer<Output, Never> {
fatalError()
}

func isEquivalent(to otherWorker: ___VARIABLE_productName___Worker) -> Bool {
return true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// ___FILEHEADER___

import Workflow
import WorkflowUI

// MARK: Input and Output

struct ___VARIABLE_productName___Workflow: Workflow {
enum Output {}
}

// MARK: State and Initialization

extension ___VARIABLE_productName___Workflow {
struct State {}

func makeInitialState() -> ___VARIABLE_productName___Workflow.State {
return State()
}

func workflowDidChange(from previousWorkflow: ___VARIABLE_productName___Workflow, state: inout State) {}
}

// MARK: Actions

extension ___VARIABLE_productName___Workflow {
enum Action: WorkflowAction {
typealias WorkflowType = ___VARIABLE_productName___Workflow

func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? {
switch self {
// Update state and produce an optional output based on which action was received.
}
}
}
}

// MARK: Rendering

extension ___VARIABLE_productName___Workflow {
// TODO: Change this to your actual rendering type
typealias Rendering = String

func render(state: ___VARIABLE_productName___Workflow.State, context: RenderContext<___VARIABLE_productName___Workflow>) -> Rendering {
#warning("Don't forget your render implementation and to return the correct rendering type!")
return "This is likely not the rendering that you want to return"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ___FILEHEADER___

import RxSwift
import Workflow
import WorkflowRxSwift
import WorkflowUI

// MARK: Workers

extension ___VARIABLE_productName___Workflow {
struct ___VARIABLE_productName___Worker: Worker {
enum Output {}

func run() -> Observable<Output> {
fatalError()
}

func isEquivalent(to otherWorker: ___VARIABLE_productName___Worker) -> Bool {
return true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// ___FILEHEADER___

import Workflow
import WorkflowUI

// MARK: Input and Output

struct ___VARIABLE_productName___Workflow: Workflow {
enum Output {}
}

// MARK: State and Initialization

extension ___VARIABLE_productName___Workflow {
struct State {}

func makeInitialState() -> ___VARIABLE_productName___Workflow.State {
return State()
}

func workflowDidChange(from previousWorkflow: ___VARIABLE_productName___Workflow, state: inout State) {}
}

// MARK: Actions

extension ___VARIABLE_productName___Workflow {
enum Action: WorkflowAction {
typealias WorkflowType = ___VARIABLE_productName___Workflow

func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? {
switch self {
// Update state and produce an optional output based on which action was received.
}
}
}
}

// MARK: Rendering

extension ___VARIABLE_productName___Workflow {
// TODO: Change this to your actual rendering type
typealias Rendering = String

func render(state: ___VARIABLE_productName___Workflow.State, context: RenderContext<___VARIABLE_productName___Workflow>) -> Rendering {
#warning("Don't forget your render implementation and to return the correct rendering type!")
return "This is likely not the rendering that you want to return"
}
}