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

Method getInitialState

docs/app/js/sanddance-app.js:12578–12592  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

12576 };
12577 }
12578 getInitialState(props) {
12579 const initialState = {
12580 groups: props.initializer.search || [
12581 this.newGroup(0, null)
12582 ],
12583 sortedColumns: [
12584 ...props.initializer.columns
12585 ].sort((a, b)=>a.name.localeCompare(b.name)),
12586 initializer: props.initializer
12587 };
12588 initialState.groups.forEach((group)=>{
12589 group.expressions.forEach((ex)=>ex.unlocked = group.expressions.length <= 2);
12590 });
12591 return initialState;
12592 }
12593 componentDidUpdate() {
12594 if (!(0, _sanddanceReact.util).deepCompare(this.props.initializer, this.state.initializer)) this.setState(this.getInitialState(this.props));
12595 }

Callers 2

constructorMethod · 0.95
componentDidUpdateMethod · 0.95

Calls 2

newGroupMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected