MCPcopy Create free account
hub / github.com/microsoft/SandDance / addExpression

Method addExpression

docs/app/js/sanddance-app.js:12659–12675  ·  view source on GitHub ↗
(groupIndex)

Source from the content-addressed store, hash-verified

12657 return ex;
12658 }
12659 addExpression(groupIndex) {
12660 const groups = [
12661 ...this.state.groups
12662 ];
12663 const group = groups[groupIndex];
12664 const maxKey = group.expressions.reduce((max, p)=>p.key > max ? p.key : max, group.expressions[0].key);
12665 const newEx = this.newExpression(maxKey + 1, "&&");
12666 group.expressions.push(newEx);
12667 if (group.expressions.length === 2) newEx.unlocked = true;
12668 else {
12669 group.expressions.forEach((ex)=>ex.unlocked = false);
12670 newEx.clause = group.expressions[1].clause;
12671 }
12672 this.setState({
12673 groups
12674 });
12675 }
12676 updateExpression(partialEx, groupIndex, index) {
12677 const groups = [
12678 ...this.state.groups

Callers 1

renderMethod · 0.95

Calls 2

newExpressionMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected