-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add combine publishers for all objects and types #73
Conversation
Codecov Report
@@ Coverage Diff @@
## main #73 +/- ##
==========================================
+ Coverage 78.45% 78.91% +0.45%
==========================================
Files 52 61 +9
Lines 4693 4870 +177
==========================================
+ Hits 3682 3843 +161
- Misses 1011 1027 +16
Continue to review full report at Codecov.
|
@TomWFox can you review the docs? All of the added docs are SwiftUI docs. The large number of line additions is mostly test code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>
[.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v5)]
Adding the publishers such as
Future
to all one-shot async calls, making Parse-Swift modernized and SwiftUI ready. All methods that are capable of “publishing” end with the wordPublisher
. This means that there are 3 ways to use most of the methods that send/receive info to a Parse Server: 1) sync, 2) async, and 3) publisher.As far as usage, you use the added publishers just like any other
Combine
publisher. The thing to remember is that all of the push/pull methods likesave
,fetch
, etc. areFutures
, so they start their work as soon as you call them and will only publish one result when finished. Any new subscriptions to an already fulfilledFuture
will produce the original result. This is different from theParseLiveQuery
Subscription
which will keep publishing events/subscriptions as long as it’s not cancelled.Combine
currently isn't supported on Linux, but if/when it ever is the combine features will automatically be available for use. Linux devs can use the async/sync callbacks instead.ParseUser.logout
to make it more predictable[.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v5)]
. If a developer wants to support an older platform, they should use the Parse-Obj-C SDKSlightly breaking (compiler should suggest the correct fix):
delete
,deleteAll
,passwordReset
, andverificationEmail
use to all return anParseError
. These have all been switched to return a Result<Void, ParseError> instead to match everything else. This is helpful, becauseFuture
expects a result enum anyways