@@ -76,21 +76,6 @@ public abstract class StatefulWorkflow<
76
76
public inner class RenderContext internal constructor(
77
77
baseContext : BaseRenderContext <PropsT , StateT , OutputT >
78
78
) : BaseRenderContext<@UnsafeVariance PropsT, StateT, @UnsafeVariance OutputT> by baseContext {
79
- @Deprecated(
80
- " Always provide a debugging name" ,
81
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
82
- )
83
- public inline fun <reified CurrentStateT : StateT & Any > safeEventHandler (
84
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
85
- ::defaultOnFailedCast,
86
- // Type variance issue: https://github.com/square/workflow-kotlin/issues/891
87
- crossinline update : WorkflowAction <
88
- @UnsafeVariance PropsT ,
89
- StateT ,
90
- @UnsafeVariance OutputT
91
- >.Updater .(currentState: CurrentStateT ) -> Unit
92
- ): () -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
93
-
94
79
/* *
95
80
* Like [eventHandler], but no-ops if [state][WorkflowAction.Updater.state] has
96
81
* changed to a different type than [CurrentStateT] by the time [update] fires.
@@ -144,23 +129,6 @@ public abstract class StatefulWorkflow<
144
129
}
145
130
}
146
131
147
- @Deprecated(
148
- " Always provide a debugging name" ,
149
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
150
- )
151
- public inline fun <reified CurrentStateT : StateT & Any , EventT > safeEventHandler (
152
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
153
- ::defaultOnFailedCast,
154
- crossinline update : WorkflowAction <
155
- @UnsafeVariance PropsT ,
156
- StateT ,
157
- @UnsafeVariance OutputT
158
- >.Updater .(
159
- currentState: CurrentStateT ,
160
- event: EventT
161
- ) -> Unit
162
- ): (EventT ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
163
-
164
132
public inline fun <reified CurrentStateT : StateT & Any , EventT > safeEventHandler (
165
133
name : String ,
166
134
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
@@ -181,24 +149,6 @@ public abstract class StatefulWorkflow<
181
149
}
182
150
}
183
151
184
- @Deprecated(
185
- " Always provide a debugging name" ,
186
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
187
- )
188
- public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 > safeEventHandler (
189
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
190
- ::defaultOnFailedCast,
191
- crossinline update : WorkflowAction <
192
- @UnsafeVariance PropsT ,
193
- StateT ,
194
- @UnsafeVariance OutputT
195
- >.Updater .(
196
- currentState: CurrentStateT ,
197
- e1: E1 ,
198
- e2: E2
199
- ) -> Unit
200
- ): (E1 , E2 ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
201
-
202
152
public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 > safeEventHandler (
203
153
name : String ,
204
154
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
@@ -220,25 +170,6 @@ public abstract class StatefulWorkflow<
220
170
}
221
171
}
222
172
223
- @Deprecated(
224
- " Always provide a debugging name" ,
225
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
226
- )
227
- public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 > safeEventHandler (
228
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
229
- ::defaultOnFailedCast,
230
- crossinline update : WorkflowAction <
231
- @UnsafeVariance PropsT ,
232
- StateT ,
233
- @UnsafeVariance OutputT
234
- >.Updater .(
235
- currentState: CurrentStateT ,
236
- e1: E1 ,
237
- e2: E2 ,
238
- e3: E3
239
- ) -> Unit
240
- ): (E1 , E2 , E3 ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
241
-
242
173
public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 > safeEventHandler (
243
174
name : String ,
244
175
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
@@ -261,26 +192,6 @@ public abstract class StatefulWorkflow<
261
192
}
262
193
}
263
194
264
- @Deprecated(
265
- " Always provide a debugging name" ,
266
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
267
- )
268
- public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 , E4 > safeEventHandler (
269
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
270
- ::defaultOnFailedCast,
271
- crossinline update : WorkflowAction <
272
- @UnsafeVariance PropsT ,
273
- StateT ,
274
- @UnsafeVariance OutputT
275
- >.Updater .(
276
- currentState: CurrentStateT ,
277
- e1: E1 ,
278
- e2: E2 ,
279
- e3: E3 ,
280
- e4: E4
281
- ) -> Unit
282
- ): (E1 , E2 , E3 , E4 ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
283
-
284
195
public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 , E4 > safeEventHandler (
285
196
name : String ,
286
197
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
@@ -304,27 +215,6 @@ public abstract class StatefulWorkflow<
304
215
}
305
216
}
306
217
307
- @Deprecated(
308
- " Always provide a debugging name" ,
309
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
310
- )
311
- public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 , E4 , E5 > safeEventHandler (
312
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
313
- ::defaultOnFailedCast,
314
- crossinline update : WorkflowAction <
315
- @UnsafeVariance PropsT ,
316
- StateT ,
317
- @UnsafeVariance OutputT
318
- >.Updater .(
319
- currentState: CurrentStateT ,
320
- e1: E1 ,
321
- e2: E2 ,
322
- e3: E3 ,
323
- e4: E4 ,
324
- e5: E5
325
- ) -> Unit
326
- ): (E1 , E2 , E3 , E4 , E5 ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
327
-
328
218
public inline fun <reified CurrentStateT : StateT & Any , E1 , E2 , E3 , E4 , E5 > safeEventHandler (
329
219
name : String ,
330
220
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
@@ -349,36 +239,6 @@ public abstract class StatefulWorkflow<
349
239
}
350
240
}
351
241
352
- @Deprecated(
353
- " Always provide a debugging name" ,
354
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
355
- )
356
- public inline fun <
357
- reified CurrentStateT : StateT & Any ,
358
- E1 ,
359
- E2 ,
360
- E3 ,
361
- E4 ,
362
- E5 ,
363
- E6
364
- > safeEventHandler (
365
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
366
- ::defaultOnFailedCast,
367
- crossinline update : WorkflowAction <
368
- @UnsafeVariance PropsT ,
369
- StateT ,
370
- @UnsafeVariance OutputT
371
- >.Updater .(
372
- currentState: CurrentStateT ,
373
- e1: E1 ,
374
- e2: E2 ,
375
- e3: E3 ,
376
- e4: E4 ,
377
- e5: E5 ,
378
- e6: E6
379
- ) -> Unit
380
- ): (E1 , E2 , E3 , E4 , E5 , E6 ) -> Unit = safeEventHandler(" safeEventHandler" , onFailedCast, update)
381
-
382
242
public inline fun <
383
243
reified CurrentStateT : StateT & Any ,
384
244
E1 ,
@@ -412,39 +272,6 @@ public abstract class StatefulWorkflow<
412
272
}
413
273
}
414
274
415
- @Deprecated(
416
- " Always provide a debugging name" ,
417
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
418
- )
419
- public inline fun <
420
- reified CurrentStateT : StateT & Any ,
421
- E1 ,
422
- E2 ,
423
- E3 ,
424
- E4 ,
425
- E5 ,
426
- E6 ,
427
- E7
428
- > safeEventHandler (
429
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
430
- ::defaultOnFailedCast,
431
- crossinline update : WorkflowAction <
432
- @UnsafeVariance PropsT ,
433
- StateT ,
434
- @UnsafeVariance OutputT
435
- >.Updater .(
436
- currentState: CurrentStateT ,
437
- e1: E1 ,
438
- e2: E2 ,
439
- e3: E3 ,
440
- e4: E4 ,
441
- e5: E5 ,
442
- e6: E6 ,
443
- e7: E7
444
- ) -> Unit
445
- ): (E1 , E2 , E3 , E4 , E5 , E6 , E7 ) -> Unit =
446
- safeEventHandler(" safeEventHandler" , onFailedCast, update)
447
-
448
275
public inline fun <
449
276
reified CurrentStateT : StateT & Any ,
450
277
E1 ,
@@ -480,41 +307,6 @@ public abstract class StatefulWorkflow<
480
307
}
481
308
}
482
309
483
- @Deprecated(
484
- " Always provide a debugging name" ,
485
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
486
- )
487
- public inline fun <
488
- reified CurrentStateT : StateT & Any ,
489
- E1 ,
490
- E2 ,
491
- E3 ,
492
- E4 ,
493
- E5 ,
494
- E6 ,
495
- E7 ,
496
- E8
497
- > safeEventHandler (
498
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
499
- ::defaultOnFailedCast,
500
- crossinline update : WorkflowAction <
501
- @UnsafeVariance PropsT ,
502
- StateT ,
503
- @UnsafeVariance OutputT
504
- >.Updater .(
505
- currentState: CurrentStateT ,
506
- e1: E1 ,
507
- e2: E2 ,
508
- e3: E3 ,
509
- e4: E4 ,
510
- e5: E5 ,
511
- e6: E6 ,
512
- e7: E7 ,
513
- e8: E8
514
- ) -> Unit
515
- ): (E1 , E2 , E3 , E4 , E5 , E6 , E7 , E8 ) -> Unit =
516
- safeEventHandler(" safeEventHandler" , onFailedCast, update)
517
-
518
310
public inline fun <
519
311
reified CurrentStateT : StateT & Any ,
520
312
E1 ,
@@ -552,43 +344,6 @@ public abstract class StatefulWorkflow<
552
344
}
553
345
}
554
346
555
- @Deprecated(
556
- " Always provide a debugging name" ,
557
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
558
- )
559
- public inline fun <
560
- reified CurrentStateT : StateT & Any ,
561
- E1 ,
562
- E2 ,
563
- E3 ,
564
- E4 ,
565
- E5 ,
566
- E6 ,
567
- E7 ,
568
- E8 ,
569
- E9
570
- > safeEventHandler (
571
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
572
- ::defaultOnFailedCast,
573
- crossinline update : WorkflowAction <
574
- @UnsafeVariance PropsT ,
575
- StateT ,
576
- @UnsafeVariance OutputT
577
- >.Updater .(
578
- currentState: CurrentStateT ,
579
- e1: E1 ,
580
- e2: E2 ,
581
- e3: E3 ,
582
- e4: E4 ,
583
- e5: E5 ,
584
- e6: E6 ,
585
- e7: E7 ,
586
- e8: E8 ,
587
- e9: E9
588
- ) -> Unit
589
- ): (E1 , E2 , E3 , E4 , E5 , E6 , E7 , E8 , E9 ) -> Unit =
590
- safeEventHandler(" safeEventHandler" , onFailedCast, update)
591
-
592
347
public inline fun <
593
348
reified CurrentStateT : StateT & Any ,
594
349
E1 ,
@@ -630,45 +385,6 @@ public abstract class StatefulWorkflow<
630
385
}
631
386
}
632
387
633
- @Deprecated(
634
- " Always provide a debugging name" ,
635
- ReplaceWith (" safeEventHandler(\" TODO: debugging name\" , onFailedCast, update)" )
636
- )
637
- public inline fun <
638
- reified CurrentStateT : StateT & Any ,
639
- E1 ,
640
- E2 ,
641
- E3 ,
642
- E4 ,
643
- E5 ,
644
- E6 ,
645
- E7 ,
646
- E8 ,
647
- E9 ,
648
- E10
649
- > safeEventHandler (
650
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
651
- ::defaultOnFailedCast,
652
- crossinline update : WorkflowAction <
653
- @UnsafeVariance PropsT ,
654
- StateT ,
655
- @UnsafeVariance OutputT
656
- >.Updater .(
657
- currentState: CurrentStateT ,
658
- e1: E1 ,
659
- e2: E2 ,
660
- e3: E3 ,
661
- e4: E4 ,
662
- e5: E5 ,
663
- e6: E6 ,
664
- e7: E7 ,
665
- e8: E8 ,
666
- e9: E9 ,
667
- e10: E10
668
- ) -> Unit
669
- ): (E1 , E2 , E3 , E4 , E5 , E6 , E7 , E8 , E9 , E10 ) -> Unit =
670
- safeEventHandler(" safeEventHandler" , onFailedCast, update)
671
-
672
388
public inline fun <
673
389
reified CurrentStateT : StateT & Any ,
674
390
E1 ,
@@ -715,18 +431,6 @@ public abstract class StatefulWorkflow<
715
431
}
716
432
}
717
433
718
- @Deprecated(
719
- " Always provide a debugging name." ,
720
- ReplaceWith (" safeAction(\" TODO: name\" , onFailedCast, update)" )
721
- )
722
- public inline fun <reified CurrentStateT : StateT & Any > safeAction (
723
- crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
724
- ::defaultOnFailedCast,
725
- noinline update : WorkflowAction <PropsT , StateT , OutputT >.Updater .(
726
- currentState: CurrentStateT
727
- ) -> Unit
728
- ): WorkflowAction <PropsT , StateT , OutputT > = safeAction(" safeAction" , onFailedCast, update)
729
-
730
434
/* *
731
435
* Like [action], but no-ops if [state][WorkflowAction.Updater.state] has
732
436
* changed to a different type than [CurrentStateT] by the time [update] fires.
@@ -970,15 +674,6 @@ public inline fun <StateT, OutputT, RenderingT> Workflow.Companion.stateful(
970
674
{ _, state -> render(state) }
971
675
)
972
676
973
- @Deprecated(
974
- " Always provide a debugging name" ,
975
- ReplaceWith (" action(\" TODO: debugging name\" , update)" )
976
- )
977
- public fun <PropsT , StateT , OutputT , RenderingT >
978
- StatefulWorkflow <PropsT , StateT , OutputT , RenderingT >.action (
979
- update : WorkflowAction <PropsT , StateT , OutputT >.Updater .() -> Unit
980
- ): WorkflowAction <PropsT , StateT , OutputT > = action(" " , update)
981
-
982
677
/* *
983
678
* Convenience to create a [WorkflowAction] with parameter types matching those
984
679
* of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update]
0 commit comments