RocketData
RocketData copied to clipboard
How to purge all items in the DataProvide and empty the cache in one shot?
When a user logs out, we need to purge but it doesn't seem that you guys support a complete purge...
Is this the only way?
// Purge let count = self?.usersDataProvider.count ?? 0 for index in stride(from: count, to: 0, by: -1) { self?.usersDataProvider.remove(at: index) }
In the LinkedIn app, when the user logs out we tear down all the view controllers. Since the data providers are owned by the view controller, they automatically get purged.
The easiest way to purge is to just create a new data provider.