Parse-Swift icon indicating copy to clipboard operation
Parse-Swift copied to clipboard

Simplify updating object

Open mtrezza opened this issue 3 years ago • 1 comments
trafficstars

New Feature / Enhancement Checklist

Current Limitation

While https://github.com/parse-community/Parse-Swift/issues/401 with its PR https://github.com/parse-community/Parse-Swift/pull/406 was a great simplification when updating an object, it still requires special consideration when updating an object.

Specifically:

  • A developer still has to keep in mind that there is a special approach with obj.key.set(\.key, to: "value2") (see example) needed to only send updated keys to the server, and they cannot simply use obj.key = "value2".
  • The special method obj.key.set(\.key, to: "value2") contains a duplication of parameters; it requires a reference to key two times.

Feature / Enhancement Description

Further simplify to allow to use obj.key = "value2" without calling any special method.

Example Use Case

Example

Alternatives / Workarounds

Status quo

References

  • Discussion about possible approach: https://github.com/parse-community/Parse-Swift/pull/263

mtrezza avatar Sep 11 '22 21:09 mtrezza

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!