giu icon indicating copy to clipboard operation
giu copied to clipboard

more effective state system

Open gucio321 opened this issue 3 years ago • 2 comments

Related problem

writing state system impl takes always a lot of time, like:

  • implement widgetState struct
  • implement constructor for it these points are constant, however, I need to write as well:
  • getState method that gets state from giu, runs constructor if it is nil or does tpecasting if it isn't

Your request

Context.GetState returns Disposable but now, when generics are on, it could return the exact type right?

Alternative solution

No response

Additional context

No response

gucio321 avatar Jun 05 '22 16:06 gucio321

@gucio321 Agree, it's better to return actural type rather then interface.

AllenDang avatar Jun 06 '22 06:06 AllenDang

meh, unfortunetly, method cannot have type parameter :-(

./Context.go:108:27: syntax error: method must have no type parameters

so it isn't possible yet or I'm doing something wrong image

gucio321 avatar Jun 06 '22 15:06 gucio321

it is fixed

gucio321 avatar May 09 '23 16:05 gucio321