Giter Club home page Giter Club logo

Comments (1)

Ivshti avatar Ivshti commented on July 21, 2024

Due to many complicated bits, like the player and detail page, we're most likely elm-ing it.

  • we can do update(&mut self, &Ctx) for regular containers
  • the Ctx itself will be a container that exposes an update(&mut self, &action)
  • the Ctx container may actually become cleaner than the contextM since we'll just make a message Internal::UpdateCtx and eliminate the need for interior mutability
  • a #[derive] macro will allow us to compose many types that implement update
  • this will compose in nicely with elm-like frameworks (seed-rs) but it will also compose great with React/Conrod/whatever with a bit of glue: create a struct that manages mutability and Ctx; we can also provide glue:
    • something that will return a channel Sender (for actions) and a Receiver (for new states and other outputs, e.g. errors), and will manage context and will consume a struct that implements update
  • LibAddon's interior mutability might need to be re-thought too
  • we should probably sync the library on log-in; It makes a lot of sense for UX

Example API:

// TODO all those will have to take a type arg for Env....
#[derive(StremioModel)]
pub struct StremioModel {
   pub discover: CatalogFiltered,
   pub board: CatalogGrouped,
   pub player: Player<PlayerImpl>
}

let mut stremio = StremioModel::new();
let ctx = Ctx::new();
stremio.update(&ctx); // will return a Vec of futures that have to be handled

// or more sophisticated
// TODO: figure out a better name for this
let (tx, rx) = App::with_managed_context::<Env>();
// send actions to tx
//rx.for_each() // do something with the new &model

NOTE: the models might have to take AddonTransport besides Env

from stremio-core.

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.