Giter VIP home page Giter VIP logo

kds's People

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

Watchers

 avatar  avatar

kds's Issues

Fix library architecture

Another one architecture idea is to make something like properties as root entity. Files should be encapsulated under this and extends properties. I should create new abstract entity responsible for writing content synchronous or asynchronous.

Add android bundle integration

class MainActivity : Activity() {
  private object MBundle : KBundleDataStorage() {
    var selectedTab by integer { R.id.home }
    var selectedPicture by nullableString()  // URI
  }
  
  override fun onCreate(bundle: Bundle) = MBundle.fillBundle(bundle) {
    setSelectedTab(MainScreen.selectedTab)
    setPicture(selectedPicture)
  }
  
  override fun onSaveInstanceState() = MBundle.bundle
  
  private fun setSelectedTab(id: Int) = TODO()
  private fun setPicture(pictureUri: String) = TODO()
}

This potentially may reduce pain from state saving in android. May be a replacement of libraries kind of a bundle delegates since the api used there is common with preferences.

Explanation of commit/load awaiting

awaitLoading()

Required at start of your program to await file reading

Why just not to read file blocking when class instance created?
The files with data are usually small, but for example if your android app runs on low version and you are using object to initialize storage, you can get freeze at lazy initialization.
Firstly that let you know where your app can be freezed, so better to freeze it in onCreate (because usually it takes some time to start activity) than when a button clicked

Useless in browser JS, because there localStorage uses as storage for data. (blocking and lightweight operation)

awaitLastCommit()

Required at application finish to await saving coroutine if it exists

Useless in infinity-running apps (or lifecycle-dependent) such as Android App, IOS app, Web server, JS Frontend.
I found it required only in colsole apps

Deploy to `mavenCentral()`

After a while library should be deployed to maven central, so anyone can import it without including maven.kotlingang.org
Priority is low since now it is not actual.

Add tests

There are already some manual tests in json/json-files-jvm, but I should make a lot of "automated" tests

Reimplement library

Library should be rewritten to provide more intuitive API without synchronization 'hacks' and with better functionality splitting

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.