Skip to content

Commit

Permalink
Collapsing two fns into one
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Oct 23, 2023
1 parent f25bd39 commit b204d57
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/runtimePipelineYazzUiMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,8 @@ ${formprop.fn}

let isAsync = true
let appProps = mm.getAllAppProperties()
let fnDetails = null


for (let appPropertyDetails of appProps) {
if (appPropertyDetails.id == appMethodId) {
Expand All @@ -1625,34 +1627,32 @@ ${formprop.fn}
} else {
isAsync = false
}
}
}
debugger
return mm.convertAppMethodStringToFn( appMethodId , isAsync)
},
convertAppMethodStringToFn: function ( appMethodId , isAsync ) {
let mm = this
let innerMethodSrcCode = mm.model[appMethodId]
let thecode =
`(${isAsync?"async ":""}function({arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10}) {
let argsToUserCode = {}

let mm = this
let innerMethodSrcCode = mm.model[appMethodId]
let thecode =
`(${isAsync?"async ":""}function({arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10}) {
${innerMethodSrcCode}
})`
let debugFcc = getDebugCode(
"app." + appMethodId,
thecode,
{
skipFirstAndLastLine: true
})
let wrapperMethodSrcCode =
`(${isAsync?"async ":""}function(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) {
let debugFcc = getDebugCode(
"app." + appMethodId,
thecode,
{
skipFirstAndLastLine: true
})
let wrapperMethodSrcCode =
`(${isAsync?"async ":""}function(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) {
let Form_1=mm.model
let innerf= ${debugFcc}
let retv = innerf({arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10, Form_1})
return retv
})
`

fnDetails = eval(wrapperMethodSrcCode)
fnDetails = eval(wrapperMethodSrcCode)
}
}
return fnDetails
},
deleteCursor: function ( ) {
Expand Down

0 comments on commit b204d57

Please sign in to comment.