hoist-react icon indicating copy to clipboard operation
hoist-react copied to clipboard

Support `@persist`ing non-JSON based preference values via `PrefProvider`

Open amcclain opened this issue 8 months ago • 0 comments

I was in a bit of a rush when I first put in this ticket, but I believe the issue is that:

class MyModel extends HoistModel {
    
    @persist.with({prefKey: 'faveNumber'})
    faveNumber: number = 42;
}

does not work if we want the faveNumber pref to be of type int (vs. having pref be json with a value like {faveNumber: 42}, which would work but is sub-optimal when you really just want a primitive value)

amcclain avatar Jun 01 '24 14:06 amcclain