Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataSaverPreferences的readData问题 #10

Open
lantah-1 opened this issue Dec 30, 2024 · 1 comment
Open

DataSaverPreferences的readData问题 #10

lantah-1 opened this issue Dec 30, 2024 · 1 comment

Comments

@lantah-1
Copy link

CleanShot 2024-12-30 at 12 37 36@2x
这里的when判断应该是判断T的类型而不是判断default的类型吧?

比如这样使用,初始化的值是null,进来when判断就会有问题
mutableDataSaverStateOf<UserInfoEntity?>( DefaultDataSaverMMKV, "userInfo", null, async = false, )

@FunnySaltyFish
Copy link
Owner

是应该判断T,不过判断T怎么写呢;你这个例子会走到被注册的 typeConverters 里面,到是可以正确执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants