statefun-rust icon indicating copy to clipboard operation
statefun-rust copied to clipboard

Macro to simplify user experience

Open slinkydeveloper opened this issue 5 years ago • 2 comments

Hi, It would be nice to have some procedural macro to simplify the user experience for:

  • extracting the state from the context
  • generate the main, avoiding the boilerplate

For example:

#[stateful_function("example/greet")]
pub fn greet(context: Context, request: GreetRequest, #[state("seen_count")] state: Option<Int32Value>) -> Effects {
  //code
}

If you're interested in this feature, i'm willing to give it a try!

slinkydeveloper avatar Aug 05 '20 10:08 slinkydeveloper

Hi,

I'd be interested in something like this, yes! And sorry for the late response, I was on vacation for three weeks!

aljoscha avatar Aug 24 '20 08:08 aljoscha

Cool, I'm gonna give it a shot soon! :smile:

slinkydeveloper avatar Aug 31 '20 08:08 slinkydeveloper