Stremio / stremio-core

⚛️ The Stremio Core: types, addon system, UI models, core logic
MIT License
978 stars 68 forks source link

final design decisions before v1.0 #43

Closed Ivshti closed 5 years ago

Ivshti commented 5 years ago

in light of using this in stremio-web, stremio-example-seed, stremio-example-sauron, stremio-example-ui and stremio-ng-example,

there are a few more design decisions to make before finalizing:

see also: https://github.com/Stremio/stremio-core/issues/28

Ivshti commented 5 years ago

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

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