Modeling a Mobile App's Online/Offline Service State
What might be the best way to model a service that could be up or down at any given time? Since my app is a mobile app I need to handle online vs offline state gracefully. I can't always assume that the backend is accessible. I could have a service where every api fails with an OfflineError when there's no connection. I could also have a service that suspends any effects that need the connection until it becomes available again. I could do a mix of both where apis wait for a connection but fail if they can't get it within a timeout. There's also the
Reloadable utility but I'm not sure that's really a good fit. Is anybody working with potentially flaky services? Any thoughts on the best way to handle these situations with Effect?