init
The init
function has to been called before using asm-dom
, in the main
function, to prepare its environment. It takes a Config
struct defined as follows:
struct Config {
bool clearMemory = true;
bool unsafePatch = false;
}
clearMemory
:true
by default, set it tofalse
if you want to free memory manually, for more information see memory management.unsafePatch
:false
by default, set it totrue
if you haven't a singlepatch
in your application. This allows you to call patch with anoldVnode
that hasn't been used previously.
Config config = Config();
config.unsafePatch = true;
init(config);