Reference Source

js/rendering/rendering_function.js

// NPM IMPORTS

// COMMON IMPORTS
import T               from '../utils/types'
import RenderingResult from './rendering_result'


// let context = 'common/rendering/rendering_function'



/**
 * Rendering process with given state, produce a rendering result.
 * 
 * @param {object} arg_settings - rendering item settings.
 * @param {object} arg_state - component state.
 * @param {object} arg_rendering_context - rendering context: { resolver:..., credentials:..., rendering_factory:... }.
 * @param {RenderingResult} arg_rendering_result - rendering result to update.
 * 
 * @returns {RenderingResult} - updated Rendering result: VNode or Html text, headers.
 */
export default (arg_settings, arg_state={}, arg_rendering_context, arg_rendering_result)=>{
	return T.isObject(arg_rendering_result) && arg_rendering_result.is_rendering_result ? arg_rendering_result : new RenderingResult()
}