This is a major change to our model, API calling, and well... just about everything.
@dsymhoven I strongly recommend that we merge any changes you made before, because this branch will most certainly break something. Fixing them here will be waaaay easier ;) than the other way around.
So! What's new?
Well, there's no more BONetworkManager, BOSynchronizeManager or any of those. We are no longer caching anything!
The model we gather from the API was completely reimplemented (it was easier that way).
I'm only talking about what we get from the API, so all classes like MapLocation are intact.
The big changes are:
API Calls are now made from the classes themselves. For instance, if you want all postings do write:
Post.all().onSuccess { posts in
// Do something with your postings
}
We can also add error handling with:
Post.all().onSuccess { posts in
// Do something with your postings
}
.onError { error in
// Handle Error
}
There's of course more complex calls like:
Post.all(since: id).onSuccess { posts in
// Do something with your postings
}
Post.post(text: message, latitude: latitude, longitude: longitude, media: [image]).onSuccess { post in
// Do something with your post
}
The rest of the classes follow more or less this same schema.
All items that download something else, such as an Image or a Video now implement the protocol Observable
This means that we can observe these and get notifications when something changes.
To get updates you can simply call:
import Sweeft
/// REST of your code
observableItem >>> { updatedItem in
// Refresh any UI concerning this item
}
Let's be careful about this one!
This is a major change to our model, API calling, and well... just about everything.
@dsymhoven I strongly recommend that we merge any changes you made before, because this branch will most certainly break something. Fixing them here will be waaaay easier ;) than the other way around.
So! What's new?
Well, there's no more BONetworkManager, BOSynchronizeManager or any of those. We are no longer caching anything!
The model we gather from the API was completely reimplemented (it was easier that way). I'm only talking about what we get from the API, so all classes like MapLocation are intact.
The big changes are:
We can also add error handling with:
There's of course more complex calls like:
The rest of the classes follow more or less this same schema.
This means that we can observe these and get notifications when something changes. To get updates you can simply call:
This PR also comes with a few extra features:
And scraps the following dependencies:
And added:
Dependencies that might be dropped later: