Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

better state management #42

Open
dvc94ch opened this issue Jul 10, 2020 · 1 comment
Open

better state management #42

dvc94ch opened this issue Jul 10, 2020 · 1 comment
Milestone

Comments

@dvc94ch
Copy link
Collaborator

dvc94ch commented Jul 10, 2020

The current state management was built for a cli not a ui

@shekohex
Copy link

Hey, as we were discussing that yesterday. we got an idea is that the client sends a stream of events to the Dart and from there these events should derive the UI state and update them as we receive them.

I made a simple demo of how we could use Rust streams/channels from the Dart side.
https://github.com/shekohex/rustystream

The problem is how we could encode different events on the same stream, for my demo I went with JSON as it is universal between languages, but JSON is not strongly-typed and has a lot of overhead, so maybe we could use something like protocol buffers so we get both a unified schema (contract) between Dart and Rust, also we get code generator for both languages for free.

In Rust, we will use prost and for Dart, we will use the official google package that gets auto-generated for us see here.

@dvc94ch dvc94ch added this to the testnet milestone Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants