Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolveInitialValueWithParameters(templateName, parameters) {
if (!templateExists(templateName)) {
// eslint-disable-next-line no-console
console.warn('Template "%s" not defined, using empty initial value', templateName)
return of({isResolving: false, initialValue: undefined})
}
return from(resolveInitialValue(getTemplateById(templateName), parameters)).pipe(
map(initialValue => ({isResolving: false, initialValue}))
)
}