import '../types';

export const Primitive = Symbol("primitive");

/**
 * Takes care of rendering a Primitive-type (text, boolean, number, ...)
 *
 * @class
 * @implements {VNodeRenderer}
 */
export const PrimitiveRenderer = {
    /**
     * @param {VRenderItem} item
     */
    create(item){
        return item.document.createTextNode(item.vnode);
    },
    
    /**
     * @param {VRenderItem} item
     */
    update(item){
        /**
         * @type {Text}
         */
        let host = item.host;
        host.data = item.vnode;
    }
};
