This commit is contained in:
Leifer Mendez
2022-11-19 21:17:18 +01:00
parent 0c850d47d7
commit c40c0c54bd
2 changed files with 0 additions and 13 deletions

View File

@@ -1,17 +1,12 @@
const { toSerialize } = require('./methods')
class FlowClass {
allContexts = []
allCallbacks = []
flowSerialize = []
flowRaw = []
constructor(_flow) {
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
this.flowRaw = _flow
this.allContexts = _flow
.map((ctxs) => ctxs.ctx.contexts)
.flat(2)
.map((c, i) => ({ getCtx: c?.getCtx, index: i }))
this.allCallbacks = _flow
.map((cbIn) => cbIn.ctx.callbacks)

View File

@@ -52,13 +52,6 @@ const addAnswer =
},
])
const contexts = [].concat(inCtx.contexts).concat([
{
ref: lastCtx.ref,
getCtx: () => lastCtx,
},
])
return {
...lastCtx,
ref,
@@ -66,7 +59,6 @@ const addAnswer =
json,
options,
callbacks,
contexts,
}
}