You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would catch anywhere the user updates a row struct but forgets to commit it. This is likely to be particularly helpful to new users who don't understand the data model, but it would help experienced users as well.
E.g.
fnupdate_username(ctx:&ReducerContext,id:UID,name:String){letmut user = ctx.db.user().id().find(id);
user.name = name;// whoops! this does nothing!!}
Downsides
You have to explicitly discard rows you don't need, e.g.
fnupdate_username(ctx:&ReducerContext,id:UID,name:String){letmut user = ctx.db.user().id().find(id);
user.name = name;// now you need this `let _ =` to avoid a warning, because the `update` method returns the updated row.let _ = ctx.db.user().id().update(user);}
This makes using Row structs as plain-old-structs slightly less convenient. I still think it's worth it.
The text was updated successfully, but these errors were encountered:
Upsides
This would catch anywhere the user updates a row struct but forgets to commit it. This is likely to be particularly helpful to new users who don't understand the data model, but it would help experienced users as well.
E.g.
Downsides
You have to explicitly discard rows you don't need, e.g.
This makes using Row structs as plain-old-structs slightly less convenient. I still think it's worth it.
The text was updated successfully, but these errors were encountered: