hoodiehq / hoodie-connection-status

:dog: connection status API for the browser
Apache License 2.0
5 stars 10 forks source link

drop localStorage dependency #60

Closed gr2m closed 7 years ago

gr2m commented 7 years ago

part of hoodiehq/camp#101

Features

  1. connectionStatus.ready returns a promise that resolves once the last state was loaded from store
  2. new ConnectionStatus(options) now accepts options.store which can be a custom API with async get,set,unset methods

Breaking changes

  1. connectionStatus.isChecking is now a property (as described in README). It was implemented as function before
  2. connectionStatus.ok does not return false if a connection error was persisted before until connectionStatus.ready resolved
  3. new ConnectionStatus(options): options.cache.timeout is now options.cacheTimeout
varjmes commented 7 years ago

Is this a WIP? Judging by your last commit? If so please pop WIP on the PR body else I might accidentally merge it!

gr2m commented 7 years ago

yes, sorry, done!

gr2m commented 7 years ago

🛎 ping @hoodiehq/maintainers this PR is ready for review 👀

I know it looks like huge, but most of the changes are about wrapping logic into state.ready.then(function () { ... })