orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.33k stars 134 forks source link

[Docs] Proper technique for clearing cache? #904

Closed bradjones1 closed 2 years ago

bradjones1 commented 2 years ago

I am using Orbit in a native app and would like to clear the memory source's cache when the user logs out. It seems the "right" way to do this currently would be to disable the coordinator (so operations don't get sent to the canonical, remote json:api source), delete everything, and then re-enable? Is there a way to simply clear the memory source's storage, completely?

dgeb commented 2 years ago

Both the memory source and its cache have reset methods. I'd recommend that you call the source's async reset method since it resets the cache as well as the transformLog, which in turn clears any tracked transforms.

bradjones1 commented 2 years ago

Ah, beautiful. I see that now in the API docs. Sorry for the noise and as always for your kind responses.