Skip to content

Not issue, suggestion #7

Description

@getreup

Hey darkrishabh,

No issue, just wanted to suggest maybe making a lazy table creator in your DB.js, like so:

var RNDBModel = require('react-native-db-models')
var DB = {
    table : function(tableName)
    {
      if( typeof DB[tableName] === 'undefined' ) DB[tableName] = new RNDBModel.create_db(tableName);

      return DB[tableName];
    },
}
module.exports = DB

Is there a foreseeable issue with this method?

The advantage is that if you have dynamic code that may add new data structures at any time, you can let that happen.

Thanks,

Kelsey

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions