Skip to content

ALinuxPerson/emyu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emyu: The Viewless MVU Framework

It's MVU, but we lost the view along the way...

⚠️ IMPORTANT: This project is under heavy construction and prototyping! Expect breaking changes and incomplete features.

Overview

Emyu is a framework for building business logic in Rust using the Model-View-Update (MVU) architecture pattern, but where the View is implemented in a foreign language, such as Dart/Flutter, Java/Kotlin/Android, Swift/iOS, and others.

The most important principle is that, from the perspective of the foreign language, the application is a black box where only the updaters and getters are exposed via FFI. The foreign language code can call the updaters to modify the application state, and it can call the getters to read the application state. The foreign language code is responsible for rendering the UI based on the state it reads from the application.

Example

pub type MyApp = AdHocApp<MyRootModel>;

pub struct MyRootModel {
    name: Signal<String>,
    age: Signal<i32>,
    employed: bool,
}

#[emyu::model(for_app = "MyApp", dispatcher(meta(base(derive(Clone)))))]
pub impl MyRootModel {
    pub fn new();

    pub fn set_attributes(&mut self, name: String, age: i32, employed: bool) {
        self.name.writer().set(name);
        self.age.writer().set(age);
        self.employed = employed;
    }

    pub fn name(&self) -> Signal<String>;
    pub fn age(&self) -> Signal<i32>;
}

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crate(s) by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

The Viewless MVU Framework

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages