Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 0ea64e3

Browse files
Scalafmt/fix
1 parent af4a4ac commit 0ea64e3

4 files changed

Lines changed: 26 additions & 19 deletions

File tree

tyrian-next/src/main/scala/tyrian/next/Action.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ object Action:
4646
/** Creates an action that runs a side effect without producing a message. */
4747
def sideEffect(thunk: => Unit): Action =
4848
Action.SideEffect(thunk)
49+
4950
/** Alias for sideEffect. */
5051
def fireAndForget(thunk: => Unit): Action =
5152
sideEffect(thunk)
53+
5254
/** Alias for sideEffect. */
5355
def thunk(run: => Unit): Action =
5456
sideEffect(run)
5557

5658
/** Creates an action that runs a process and emits the result as a message. */
5759
def run(process: () => GlobalMsg): Action =
5860
Action.Run(process)
61+
5962
/** Creates an action that runs a process and transforms the result into a message. */
6063
def run[A](process: () => A)(toMsg: A => GlobalMsg): Action =
6164
Action.Run(process)(toMsg)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
package tyrian.next
22

3-
/** Base trait for all messages in tyrian-next applications. All events, user actions, and system messages must extend GlobalMsg to participate in the application's update cycle. */
3+
/** Base trait for all messages in tyrian-next applications. All events, user actions, and system messages must extend
4+
* GlobalMsg to participate in the application's update cycle.
5+
*/
46
trait GlobalMsg

tyrian-next/src/main/scala/tyrian/next/Outcome.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,11 @@ object Outcome:
305305
/** Combines two outcomes by applying a function to their values. */
306306
def merge[A, B, C](oa: Outcome[A], ob: Outcome[B])(f: (A, B) => C): Outcome[C] =
307307
oa.merge(ob)(f)
308+
308309
/** Combines two outcomes by applying a function to their values. (Alias for merge) */
309310
def map2[A, B, C](oa: Outcome[A], ob: Outcome[B])(f: (A, B) => C): Outcome[C] =
310311
merge(oa, ob)(f)
312+
311313
/** Combines three outcomes by applying a function to their values. */
312314
def merge3[A, B, C, D](oa: Outcome[A], ob: Outcome[B], oc: Outcome[C])(f: (A, B, C) => D): Outcome[D] =
313315
for {

tyrian-next/src/test/scala/tyrian/next/HtmlRootTests.scala

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class HtmlRootTests extends munit.FunSuite:
99
HtmlFragment(
1010
p("Hello")
1111
)
12-
12+
1313
val root =
1414
HtmlRoot(frag)
1515

@@ -20,10 +20,10 @@ final class HtmlRootTests extends munit.FunSuite:
2020
div(
2121
p("Hello")
2222
)
23-
23+
2424
assertEquals(actual, expected)
2525
}
26-
26+
2727
test("resolve - multiple markups") {
2828
val frag =
2929
HtmlFragment(
@@ -33,7 +33,7 @@ final class HtmlRootTests extends munit.FunSuite:
3333
p("c")
3434
)
3535
)
36-
36+
3737
val root =
3838
HtmlRoot(frag)
3939

@@ -46,7 +46,7 @@ final class HtmlRootTests extends munit.FunSuite:
4646
p("b"),
4747
p("c")
4848
)
49-
49+
5050
assertEquals(actual, expected)
5151
}
5252

@@ -58,7 +58,7 @@ final class HtmlRootTests extends munit.FunSuite:
5858
MarkerId("1"),
5959
p("a")
6060
)
61-
61+
6262
val root =
6363
HtmlRoot(frag)
6464

@@ -69,10 +69,10 @@ final class HtmlRootTests extends munit.FunSuite:
6969
div(
7070
p("Hello")
7171
)
72-
72+
7373
assertEquals(actual, expected)
7474
}
75-
75+
7676
test("resolve - single markup, different marker, one insert") {
7777
val frag =
7878
HtmlFragment(
@@ -82,7 +82,7 @@ final class HtmlRootTests extends munit.FunSuite:
8282
MarkerId("1"),
8383
p("a")
8484
)
85-
85+
8686
val root =
8787
HtmlRoot(frag)
8888

@@ -93,7 +93,7 @@ final class HtmlRootTests extends munit.FunSuite:
9393
div(
9494
p("Hello")
9595
)
96-
96+
9797
assertEquals(actual, expected)
9898
}
9999

@@ -106,7 +106,7 @@ final class HtmlRootTests extends munit.FunSuite:
106106
MarkerId("1"),
107107
p("a")
108108
)
109-
109+
110110
val root =
111111
HtmlRoot(frag)
112112

@@ -118,7 +118,7 @@ final class HtmlRootTests extends munit.FunSuite:
118118
p("Hello"),
119119
p("a")
120120
)
121-
121+
122122
assertEquals(actual, expected)
123123
}
124124

@@ -127,15 +127,15 @@ final class HtmlRootTests extends munit.FunSuite:
127127
HtmlFragment(
128128
p("Hello"),
129129
Marker(MarkerId("1")),
130-
Marker(MarkerId("2")),
130+
Marker(MarkerId("2"))
131131
).insert(
132132
MarkerId("1"),
133133
p("a")
134134
).insert(
135135
MarkerId("2"),
136136
p("b")
137137
)
138-
138+
139139
val root =
140140
HtmlRoot(frag)
141141

@@ -148,10 +148,10 @@ final class HtmlRootTests extends munit.FunSuite:
148148
p("a"),
149149
p("b")
150150
)
151-
151+
152152
assertEquals(actual, expected)
153153
}
154-
154+
155155
test("resolve - single markup, matching marker, two inserts, nested") {
156156
val frag =
157157
HtmlFragment(
@@ -165,7 +165,7 @@ final class HtmlRootTests extends munit.FunSuite:
165165
MarkerId("2"),
166166
p("b")
167167
)
168-
168+
169169
val root =
170170
HtmlRoot(frag)
171171

@@ -178,6 +178,6 @@ final class HtmlRootTests extends munit.FunSuite:
178178
p("a"),
179179
p("b")
180180
)
181-
181+
182182
assertEquals(actual, expected)
183183
}

0 commit comments

Comments
 (0)