Giter Site home page Giter Site logo

Comments (4)

kevinresol avatar kevinresol commented on June 30, 2024

coconut.data is the official stateful data store and is preferred I suppose. Do you have a reason to not use it and go for deepstate?

from coconut.ui.

francescoagati avatar francescoagati commented on June 30, 2024

i have a project that use deepstate but i want move the ui to coconut for future scalability on other renderers

from coconut.ui.

back2dos avatar back2dos commented on June 30, 2024

As far as I understand it, the data is in a DeepStateContainer<T> and you can make it observable like so:

function tinkify<T>(container:DeepStateContainer<T>) {
  var state = new tink.state.State(container.state);
  container.subscribeObserver(Full(function (prev, next) state.set(next));//make sure it's prev and next and not next and prev
  return state.observe();
}

And as soon as you have an observable, you can pass it to coconut and it will update. I'm a bit worried about the performance implications here, but it should work correctly. Perhaps you also want to create "enclosures" as you pass data down.

All that said, coconut.ui is literally built on top of coconut.data, so gluing in another, radically different state layer is going to require a fair amount of work and the result will probably still be awkward. If you just want different renderers, then that's where you should be putting your energy.

I'm going to close this issue, but please feel free to follow up with questions you run into if you go down this road ;)

from coconut.ui.

francescoagati avatar francescoagati commented on June 30, 2024

thanks @back2dos i will try tinfiy deepstate for see what happens.

from coconut.ui.

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.