simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

[app-state] Feature request: graceful `MigrationManager` error behavior #68

Closed eric-simonton-sama closed 11 months ago

eric-simonton-sama commented 2 years ago

It seems like a common case to want MigrationManager to fall back to the default state if it runs into any issues. Is there a nice way that could be supported without having to make a custom subclass?

Maybe any real use case will want a custom subclass anyway - not sure if it's really worth it. But while prototyping and slowly increasing the stability of an app it seems useful to slap in a default to a [PersistentStore](https://github.com/simontonsoftware/s-libs/issues/67) that silently starts fresh when I change the schema. Almost like a NonMigrationManager 🙂.

Maybe this could be a feature specifically of PersistedStore. The migration manager could be optional, and if there isn't one we use this behavior.

ersimont commented 11 months ago

This will be in the next release