Skip to content

Commit

Permalink
Update samples to use result builder
Browse files Browse the repository at this point in the history
  • Loading branch information
emorydunn committed Mar 11, 2024
1 parent e424a0f commit 942ec62
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ class CounterPlugin: Plugin {

static var version: String = "0.4"

static var actions: [any Action.Type] = [
IncrementAction.self,
DecrementAction.self
]
@ActionBuilder
static var actions: [any Action.Type] {
IncrementAction.self
DecrementAction.self
RotaryAction.self
}

required init() { }

Expand All @@ -41,6 +43,16 @@ A plugin both defines the code used to interact with the Stream Deck and the man
Many of the properties are shown to users, such as the name and description. Others are used internally by the Stream Deck application. The most important property is `actions` which is where you define the actions your plugin provides.

```swift

// Define actions with a builder
@ActionBuilder
static var actions: [any Action.Type] {
IncrementAction.self
DecrementAction.self
RotaryAction.self
}

// Or define actions in an array
static var actions: [any Action.Type] = [
IncrementAction.self,
DecrementAction.self
Expand Down

0 comments on commit 942ec62

Please sign in to comment.