-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
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
Reactions are currently unavailable