Open IlyaSemenov opened 2 years ago
I'm inclined to getting rid of it. Basically, there are 3 different cases for the arg:
Calling ctx.scene.call("subscene", arg)
could save arg into ctx.scene.session
of the new scene instead.
Basically, we can get rid of arg. If the user needs it, they can use typed ctx.scene.session
to pass data around.
This is useful in certain scenarios, but I don't know how to handle it without ctx.scene.arg
? Unlike calling scene when we can simply treat argument as the initial value of theirs session, we can't put the return value into ours session as we will lose valuable data.
May be call it ctx.scene.exitValue
(similar naming to bash exit code)?
ctx.scene.arg
is needed but feels like a hack. Also, I didn't find a way to enforce typings on it.It is used for passing initial data to top-level or nested scenes, and also to "return" data when a nested scene exits and the outer scene proceeds. I was considering merging it with
ctx.scene.session
but I'm not sure how (and if that's a reasonable approach at all).