You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is part feature, as it introduces new functionality, and part bug, as really it should have always returned a disposer to begin with.
Without a disposer there is, well, no way to dispose of the onSnapshot listener, and therefore no way to pause / stop persistence. A disposer is returned from onSnapshot and should be returned by persist. As it currently returns a Promise, it should be within that Promise.
While the current Promise returns the snapshot of persisted data, that's actually undocumented behavior as you can get the snapshot directly from the store anyway. It's not particularly useful behavior as a result; when I originally created this, I just figured I'd return something rather than nothing/void.
So while this would be breaking, I think it should be ok to change without a major as I don't believe anyone's using that functionality (though no one's requested this functionality either, as it's a fairly uncommon need).
As this is part feature and part breaking change, leaning toward releasing this change as a minor (and breaking changes in minors are ok in semver for 0.x releases) rather than a patch.
The text was updated successfully, but these errors were encountered:
This is part feature, as it introduces new functionality, and part bug, as really it should have always returned a disposer to begin with.
Without a disposer there is, well, no way to dispose of the
onSnapshot
listener, and therefore no way to pause / stop persistence. Adisposer
is returned fromonSnapshot
and should be returned bypersist
. As it currently returns a Promise, it should be within that Promise.While the current Promise returns the snapshot of persisted data, that's actually undocumented behavior as you can get the snapshot directly from the store anyway. It's not particularly useful behavior as a result; when I originally created this, I just figured I'd return something rather than nothing/void.
So while this would be breaking, I think it should be ok to change without a major as I don't believe anyone's using that functionality (though no one's requested this functionality either, as it's a fairly uncommon need).
As this is part feature and part breaking change, leaning toward releasing this change as a minor (and breaking changes in minors are ok in semver for 0.x releases) rather than a patch.
The text was updated successfully, but these errors were encountered: