Unbind functions that dont need binding

Co-authored-by: Delmer Reed <delmer814+1@gmail.com>
pull/3654/head
Iris Scholten 2018-06-12 16:59:30 -07:00
parent 68c41a14c6
commit 3b3d3813ed
3 changed files with 9 additions and 12 deletions

View File

@ -72,7 +72,7 @@ class BodyBuilder extends PureComponent<Props> {
<FuncSelector
bodyID="fake-body-id"
declarationID="fake-declaration-id"
onAddNode={this.createNewBody}
onAddNode={this.handleCreateNewBody}
funcs={this.newDeclarationFuncs}
connectorVisible={false}
/>
@ -82,7 +82,7 @@ class BodyBuilder extends PureComponent<Props> {
)
}
private isLastBody = (bodyIndex: number): boolean => {
private isLastBody(bodyIndex: number): boolean {
const {body} = this.props
return bodyIndex === body.length - 1
@ -111,7 +111,7 @@ class BodyBuilder extends PureComponent<Props> {
return declarations
}
private createNewBody = name => {
private handleCreateNewBody = name => {
if (name === funcNames.FROM) {
this.props.onAppendFrom()
}

View File

@ -179,7 +179,7 @@ class ExpressionNode extends PureComponent<Props, State> {
)
}
private isNextFuncYield = (funcIndex: number): boolean => {
private isNextFuncYield(funcIndex: number): boolean {
const {funcs, isLastBody} = this.props
const {isImplicitYieldToggled} = this.state

View File

@ -146,7 +146,7 @@ export class FluxPage extends PureComponent<Props, State> {
onToggleYield: this.handleToggleYield,
service: this.service,
data: this.state.data,
scriptUpToYield: this.scriptUpToYield,
scriptUpToYield: this.handleScriptUpToYield,
}
}
@ -331,7 +331,7 @@ export class FluxPage extends PureComponent<Props, State> {
this.getASTResponse(script)
}
private scriptUpToYield = (
private handleScriptUpToYield = (
bodyID: string,
declarationID: string,
funcNodeIndex: number,
@ -475,10 +475,7 @@ export class FluxPage extends PureComponent<Props, State> {
return `${yieldNamePrefix}${yieldsMaxResultNumber + 1}`
}
private addOrRemoveYieldFunc = (
funcs: Func[],
funcNodeIndex: number
): string => {
private addOrRemoveYieldFunc(funcs: Func[], funcNodeIndex: number): string {
if (funcNodeIndex < funcs.length - 1) {
const funcAfterNode = funcs[funcNodeIndex + 1]
@ -490,7 +487,7 @@ export class FluxPage extends PureComponent<Props, State> {
return this.insertYieldFunc(funcs, funcNodeIndex)
}
private removeYieldFunc = (funcs: Func[], funcAfterNode: Func): string => {
private removeYieldFunc(funcs: Func[], funcAfterNode: Func): string {
const filteredFuncs = funcs.filter(f => f.id !== funcAfterNode.id)
return `${this.funcsToScript(filteredFuncs)}\n\n`
@ -500,7 +497,7 @@ export class FluxPage extends PureComponent<Props, State> {
return `${this.funcsToScript(funcs)}\n\t|> ${name}()\n\n`
}
private insertYieldFunc = (funcs: Func[], index: number): string => {
private insertYieldFunc(funcs: Func[], index: number): string {
const funcsBefore = funcs.slice(0, index + 1)
const funcsBeforeScript = this.funcsToScript(funcsBefore)