russhwolf / multiplatform-settings

A Kotlin Multiplatform library for saving simple key-value data
Apache License 2.0
1.69k stars 67 forks source link

Runtime Observable Settings #184

Closed psuzn closed 8 months ago

psuzn commented 9 months ago

This adds support for the wrapper around the normal setting (#155 ) to make it runtime observable.

@russhwolf I have named it runtime-observable but we can rename it if there is a better name.

I also have added the checkObservable flag on the converter extension function, so one can just use the no-arg initializer and use the converter to make it observable. In some platforms, the instance returned by no-arg is already observable; in that case, the converter doesn't add any wrapper.

russhwolf commented 9 months ago

Thanks! I'm traveling right now so I probably won't get a chance to review this closely for a week or so.

I'm still not sure how I feel on the naming, but will probably merge it with what you have and change it before I put out a release with it.

Speaking of the next release, I already have a 1.2 branch with some other pending updates. Do you think you can rebase against that branch? If not, I can do it when I'm back. I'm guessing the only major change needed will be the gradle files because I converted the old buildsrc code to use script plugins.

russhwolf commented 9 months ago

To fix the CI failure, run the apiDump gradle task from the new module and push the api files it generates to this branch.

psuzn commented 8 months ago

@russhwolf, any update on this?

russhwolf commented 8 months ago

Thanks!