Skip to content

Add #[derive(View)] for enums and nested structs #31

@matthunz

Description

@matthunz

I think a derive macro for the view trait, especially on enums, would really benefit ergonomics.
Views that return multiple types on a condition, such as an if block or match statement, could instead return an enum with View derived.

For example, for conditional views we could return a custom enum like:

#[derive(View)]
enum UserForm {
  Login(LoginView),
  SignUp(SignUpView)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions