|
|
|
|
|
by mixonic
4352 days ago
|
|
Synchronous persistence APIs should be considered dangerous. Often they solve the immediate problem, but when you eventually need to move to an async storage solution (and in JavaScript any significantly complex task eventually becomes async) you are left with code that presumes sync behavior. This makes it difficult to refactor. Providing an API with callbacks or better yet promises forces you to write future-safe code. |
|
[1]: http://mozilla.github.io/localForage/