Home Reference Source Repository

Function

Static Public Summary
public

compile(html: string, options: OPTIONS): function(i: IncrementalDOM, h: Object)

Compile the given HTML template into a function factory.

Static Public

public compile(html: string, options: OPTIONS): function(i: IncrementalDOM, h: Object) source

import {compile} from 'idomizer/src/idomizer.js'

Compile the given HTML template into a function factory.

If the incrementalDOM argument is provided, this function will return a render function. The render function is used with IncrementalDOM.patch.

If the incrementalDOM argument is not provided, this function will return a factory function. The factory function requires the IncrementalDOM library as argument and return the render function..

Basically, when the template is compiled at build time, the IncrementalDOM should not be given. When the template is compiled at runtime, the IncrementalDOM should be given.

Params:

NameTypeAttributeDescription
html string
  • nullable: false

the template

options OPTIONS
  • optional

the options

Return:

function(i: IncrementalDOM, h: Object)

the function factory