Skip to content

Commit

Permalink
fix useTables useEffect cleanup function
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres committed Nov 29, 2023
1 parent 3a82594 commit d95d0bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useTables.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect, useRef } from 'react';
import { Datasource } from 'data/CHDatasource';

export default (datasource: Datasource, database: string): string[] => {
export default (datasource: Datasource, database: string): readonly string[] => {
const [tables, setTables] = useState<string[]>([]);

useEffect(() => {
Expand All @@ -23,7 +23,7 @@ export default (datasource: Datasource, database: string): string[] => {
});

return () => {
ignore = false;
ignore = true;
};
}, [datasource, database]);

Expand Down

0 comments on commit d95d0bb

Please sign in to comment.