Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getCurrentTableViewModel() {
const { dbConnectionsManager } = this.props;
const currentTable = dbConnectionsManager.getCurrentTable();
if (!currentTable) {
return null;
}
if (!this.currentTableViewModel) {
this.currentTableViewModel = createViewModel(currentTable);
}
if (this.currentTableViewModel.model !== currentTable) {
this.currentTableViewModel.model = currentTable;
}
return this.currentTableViewModel;
}