Giter Site home page Giter Site logo

Comments (3)

steve-the-edwards avatar steve-the-edwards commented on May 29, 2024

Problem first noted in #849 then we tried to fix in #850 but this had a bug because we were recreating anyway in order to get the StateT info in.

I believe the reason we have these StatefulWorkflow.RenderContext and StatelessWorkflow.RenderContext concrete types that just delegate to the BaseRenderContext instance passed in (which is a RealRenderContext) is so that StatelessWorkflows don't have to worry about typing the StateT.

That being said, we always cast to a StatefulWorkflow when creating the nodes (see asStatefulWorkflow) so by the time we create the node I don't see why we can't do the cast write away for the RenderContext and only deal with that.

Will spike on this.

from workflow-kotlin.

steve-the-edwards avatar steve-the-edwards commented on May 29, 2024

Note that to currently handle this for lambdas passed in teh rendering to Composables, we box the lambdas on the Compose side like so:

@Composable
fun rememberLambda(lambda: () -> Unit): () -> Unit {
  val latestLambda = rememberUpdatedState(lambda)
  return remember { { latestLambda.value.invoke() } }
}

So that we save the latest lambda but hide it from the other Composables until its invoked.

from workflow-kotlin.

steve-the-edwards avatar steve-the-edwards commented on May 29, 2024

Consider "Strong Skipping" - as discussed here - may make instance equality all we need for skipping - https://www.reddit.com/r/androiddev/comments/1an5emm/comment/kqf8dz0/

from workflow-kotlin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.