-
I have a workflow that Id like to render in two places, but Im having a hard time figuring out how I can make it happen due to the renderings being 'Any' (LoadingScreen, followed by FooScreen) and there being some optional functionality that only one of the places should include.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is kind of hard to answer in the abstract, especially the bit about lists. Is there a PR you can share, or maybe you can post a gist? |
Beta Was this translation helpful? Give feedback.
-
So you're mainly concerned with sharing the view code that displayes the history list and wires up event handlers, with the new location wanting to make it richer, yeah? The sealed class approach you put up as option 1 sounds pretty sane to me — make RenderingT a more public concern so that parent worklfows have the option of messing with it, can choose how to reflect the loading state, etc. I suspect the duplication won't be all that big a deal. If you're using RecyclerView to show the combined lists, you'd likely want pretty different treatment than in the vanilla case anyway -- have to map indices, who knows what else. |
Beta Was this translation helpful? Give feedback.
So you're mainly concerned with sharing the view code that displayes the history list and wires up event handlers, with the new location wanting to make it richer, yeah? The sealed class approach you put up as option 1 sounds pretty sane to me — make RenderingT a more public concern so that parent worklfows have the option of messing with it, can choose how to reflect the loading state, etc.
I suspect the duplication won't be all that big a deal. If you're using RecyclerView to show the combined lists, you'd likely want pretty different treatment than in the vanilla case anyway -- have to map indices, who knows what else.