Open getreup opened 9 years ago
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
Its funny, because I currently have an extended API called initDB that I have been using personally which does the similar task. I will integrate it soon. Thanks @KelseyRegan
Hey darkrishabh,
No issue, just wanted to suggest maybe making a lazy table creator in your DB.js, like so:
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