Ability to disable caching of a state module in SSR
aleclarson opened this issue · 2 comments
aleclarson commented
You might prefer to hit the database every time a page is rendered that depends on a given state module.
aleclarson commented
In v0.5, you can use TimeToLive
to achieve this.
import { defineStateModule, TimeToLive } from 'saus/client'
defineStateModule("foo", async function() {
TimeToLive.set(this.cacheKey, 0)
})
aleclarson commented
I've added a shorthand property for this
import { defineStateModule } from 'saus/client'
defineStateModule("foo", async function() {
this.maxAge = 0
})