bep / gr

Aka Go React: GopherJS bindings for Facebook React. NOTE: Still early and not production ready.
Other
164 stars 11 forks source link

Add example of structs in state #29

Open nilsmagnus opened 7 years ago

nilsmagnus commented 7 years ago

Hi Bjørn, thanks for an awesome library!

Could you add an example of how to insert/retrieve custom structs in state ?

E.g. a slice of custom struct( this is not working ):

people := c.State().Interface("people").([]Person)

bep commented 7 years ago

Yes I will -- once I figure out how to do it effectively.

This and related issues was what made take a little break from this -- hoping the GopherJS scene would somehow mature in this area, i.e. data transfers to and from server and to and from the Go and JS layer without costly serializing (which may be obvious in the Ajax sample).

I will pick up the hat and so some more thinking here.