mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08:00
types(services/sql): explicitly cast return value as type variable T instead of any
previously the type variable was useless, because `const ret = (dbConnection.transaction(func) as any).deferred();` was inferred as "any".
This commit is contained in:
parent
80dd925231
commit
af85ef0b47
@ -278,7 +278,7 @@ function transactional<T>(func: (statement: Statement) => T) {
|
|||||||
ws.sendTransactionEntityChangesToAllClients();
|
ws.sendTransactionEntityChangesToAllClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret as T;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Got error ", e);
|
console.warn("Got error ", e);
|
||||||
const entityChangeIds = cls.getAndClearEntityChangeIds();
|
const entityChangeIds = cls.getAndClearEntityChangeIds();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user