https://kotlinlang.org logo
#feed
Title
# feed
y

y9san9

06/05/2021, 4:51 PM
Hey all! The previous message is awesome, didn't want to interrupt, but anyway. Recently I've searched a library for simple key-value storage built on top of a file to store some preferences, so I decided to do the one. Later I had need such a storage in the browser (since I'm using
kotlin/js
I wanted something typesafe and convenient), so I have added support for different platforms. I was experimenting for a while with API because it was hard to unify files sync/async behavior and
localStorage
, but now it's completely friendly for any customization and soon I plan to implement SharedPreferences, NsUserDefaults, Bundle, and so on support. Also, I have ideas to integrate with frameworks such as kvision, more with the link below: https://github.com/kotlingang/kds
👍 2
I've seen https://github.com/russhwolf/multiplatform-settings, it has the same idea, but realization is a bit different since I force to use type-safe delegates instead of unsafe setters/getters
r

Robert Jaros

06/05/2021, 5:18 PM
Don't you think choosing
fun
as your root package name is a bit unfortunate? 🙂
3
y

y9san9

06/05/2021, 5:25 PM
I've made this decision a lot of time ago, when firstly bought kotlingang.fun domain, and now I encounter IDEA autocompletion issues like:
OptIn(fun .kotlingang.kds.annotation.DelicateKDSApi::class
), but for users this won't be problem since imports work nice.
😂 3
K 1
r

russhwolf

06/05/2021, 6:15 PM
FYI Multiplatform Settings has the option of using delegates if you want that type safety. I’m interested to look into your stuff more deeply, though, and understand the API differences better, especially around file stuff which I’ve been thinking would be interesting to add to my library eventually.
y

y9san9

06/05/2021, 6:38 PM
@russhwolf yup, I saw delegates, but
kds
forces to use it, there is an opt-in required in case you want to set or get data directly. In my opinion, this is kind of a different paradigm when you don't control the map with delegates just as a shortcut, but delegates fully responsible for the map control.