Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (query) {
const qArgs = [query, datascript.db(this.conn)];
if (params) {
qArgs.push(params);
}
if (rules) {
qArgs.push(rules);
}
let queryResult = datascript.q(...qArgs);
this.setState({ result: queryResult || this.state.result });
return;
}
if (pull) {
const { entityIds } = this.props;
let queryResult = datascript.pull_many(datascript.db(this.conn), pull, entityIds);
this.setState({ result: queryResult || this.state.result });
return;
}
if (dbConn) {
let queryResult = dbConn(this.conn);
this.setState({ result: queryResult || this.state.result });
}
}