@@ -20,6 +20,8 @@ export default function HostRemoteActionRunner({
2020 const [ echoResult , setEchoResult ] = useState ( '' ) ;
2121 const [ bundledDefaultResult , setBundledDefaultResult ] = useState ( '' ) ;
2222 const [ bundledEchoResult , setBundledEchoResult ] = useState ( '' ) ;
23+ const [ bundledNestedResult , setBundledNestedResult ] = useState ( '' ) ;
24+ const [ bundledIncrementResult , setBundledIncrementResult ] = useState ( '' ) ;
2325 const [ isPending , setIsPending ] = useState ( false ) ;
2426
2527 useEffect ( ( ) => {
@@ -35,21 +37,36 @@ export default function HostRemoteActionRunner({
3537 const runActions = async ( ) => {
3638 setIsPending ( true ) ;
3739 try {
38- const [ defaultValue , echoValue , bundledDefaultValue , bundledEchoValue ] =
39- await Promise . all ( [
40- defaultRemoteAction ( 'from-host-client' ) ,
41- remoteActionEcho ( 'from-host-client' ) ,
42- remoteActionBundle . bundledDefaultRemoteAction (
43- 'from-host-client-bundled' ,
44- ) ,
45- remoteActionBundle . bundledRemoteActionEcho (
46- 'from-host-client-bundled' ,
47- ) ,
48- ] ) ;
40+ const bundledIncrementFormData = new FormData ( ) ;
41+ bundledIncrementFormData . set ( 'count' , '1' ) ;
42+ const [
43+ defaultValue ,
44+ echoValue ,
45+ bundledDefaultValue ,
46+ bundledEchoValue ,
47+ bundledNestedValue ,
48+ bundledIncrementValue ,
49+ ] = await Promise . all ( [
50+ defaultRemoteAction ( 'from-host-client' ) ,
51+ remoteActionEcho ( 'from-host-client' ) ,
52+ remoteActionBundle . bundledDefaultRemoteAction (
53+ 'from-host-client-bundled' ,
54+ ) ,
55+ remoteActionBundle . bundledRemoteActionEcho ( 'from-host-client-bundled' ) ,
56+ remoteActionBundle . bundledNestedRemoteAction (
57+ 'from-host-client-bundled' ,
58+ ) ,
59+ remoteActionBundle . bundledIncrementRemoteCount (
60+ 0 ,
61+ bundledIncrementFormData ,
62+ ) ,
63+ ] ) ;
4964 setDefaultResult ( defaultValue ) ;
5065 setEchoResult ( echoValue ) ;
5166 setBundledDefaultResult ( bundledDefaultValue ) ;
5267 setBundledEchoResult ( bundledEchoValue ) ;
68+ setBundledNestedResult ( bundledNestedValue ) ;
69+ setBundledIncrementResult ( String ( bundledIncrementValue ) ) ;
5370 } finally {
5471 setIsPending ( false ) ;
5572 }
@@ -74,6 +91,12 @@ export default function HostRemoteActionRunner({
7491 < p className = "host-remote-bundled-echo-action-result" >
7592 { bundledEchoResult }
7693 </ p >
94+ < p className = "host-remote-bundled-nested-action-result" >
95+ { bundledNestedResult }
96+ </ p >
97+ < p className = "host-remote-bundled-increment-action-result" >
98+ { bundledIncrementResult }
99+ </ p >
77100 </ div >
78101 ) ;
79102}
0 commit comments