Git Product home page Git Product logo

funnysaltyfish / composedatasaver Goto Github PK

View Code? Open in Web Editor NEW
74.0 3.0 4.0 33.48 MB

在 Compose Multiplatform ( Android / JVM Desktop) 中优雅完成数据持久化 | An elegant way to do data persistence in Compose Multiplatform ( Android / JVM Desktop )

License: Apache License 2.0

Kotlin 100.00%
jetpack-compose android kotlin preferences data-store mmkv compose-multiplatform compose-multiplatform-library

composedatasaver's Introduction

composedatasaver's People

Contributors

funnysaltyfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

composedatasaver's Issues

感谢,我在网上想找到这个

jetpack compose还算是比较新,资料还不算多。

比如,用户登录后的token如何保存,是我一直想的事情。

感觉该库还不错,用用看。

再提个建议

image

  • 应该提供remove的方法
  • 并且你的泛型设计上是非空的,比如存储Parcelable的时候,默认值一般不会手动去构造,而是传一个null,业务逻辑上再做判空处理。

【需求】让DataSaverState监听数据的变化

在使用的过程中发现一个问题,在设置页放了个Switcher开关,绑定上DataSaverState,用的好好的没问题。
但我还有一个新手引导页,同样放了个开关对接同一个Key但不是同一个DataSaverState,是想让用户尝试使用这个开关来看看效果,但是当用户修改状态了以后回到设置页,设置页里的这个开关还是没有修改。设置页本身是没有被recompose的,也就是DataSaverState实际没有更新。

这个问题简单来说就是目前DataSaverState不会监听数据持久层的变化,这个需求对我来说挺有用的,但似乎也不算是特别重要的东西,我也许可以试试看看能不能构思一个改进方案给你,可行的话就之后慢慢完善来

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.