Skip to content

Commit

Permalink
Merge pull request #100 from monishsyed/ms/update-templates
Browse files Browse the repository at this point in the history
Updates to Workflow Templates
  • Loading branch information
dhavalshreyas authored Oct 5, 2021
2 parents af191b3 + 733177f commit 154e4cf
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 19 deletions.
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"
}
}

0 comments on commit 154e4cf

Please sign in to comment.