Coder Social home page Coder Social logo

default's Introduction

Mostly Open Source, Mostly Harmless

Trying to make software development less painful and more fun one repository at a time.

If you have any questions or would like to get in contact please feel free to open an issue or find me on twitter.

default's People

Contributors

cyberbeni avatar milkcocoa avatar nirma avatar nitrag avatar nk-5 avatar romanpodymov avatar thepsguy 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  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  avatar  avatar  avatar  avatar  avatar  avatar

default's Issues

Hope to support Rxswift

For example
UserDefaults.standard.rx.observe(UserModel.self, "key").subscribe(onNext: { (model) in print(model) }).disposed(by: dis)
is not working.
because observe is Data,
Thx

UserDefaults usage with suiteName

Thanks for this excellent library,

I have been using this library with the UserDefaults(suiteName: but I am facing issues in removing all values by removePersistentDomain.

Is it recommended to use it with UserDefaults(suiteName: ?

Also can we have remove All or remove feature

Cheers

Support for adding new member to struct

For example, in my app version 1.1, there is a struct:

struct A: Codable, DefaultStorable {
  var aMember:Int
}

A.write()     // ok

In my new version 1.2, the struct has new member:

struct A: Codable, DefaultStorable {
  var aMember:Int
  var aNewMember:Int
}

let a = A.read()    // -> nil

Could you please add some way to support migrating old data to new data structure? Some user callbacks, maybe?
Right now I have to do it like this:

if let a = A.read() {
      self.a = a;
 } else if let a1_1 = A1_1.read(forKey: "A.Type") {
      a = A();
      a.aMember = a1_1.aMember;
 }

Seemengly crashes when model of class is changed

Hi,

Not sure if this is chance or not, but it happened to me twice that fetch crashed after the model (variables) of my class changed. Since changing the model on upgrades is a fairly common thing, I wonder if this can be somehow avoided/repaired?

Version update

Hey!

First of all, thank you for your hard work.

Could you please release a new version containing the static version of clear?

Thanks,
Andor

Clear key

What would the proper method for clearing a stored object?

Would be nice to have:

var me: User? = nil
me = User(...)
me.write()
....
//logout
me.clear()
print(me) --> nil
me.read() --> nil

Function naming

DefaultStorable

Instead of:

static func fetchFromDefaults(key: String?) -> Self?
func storeToDefaults(key: String?)

I think we should have:

static func fetch(key: String?) -> Self?
func store(key: String?)

Or maybe also have the parameter unnamed, not exactly sure on that yet.
What do you think about it?

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.