How to use the riot/lib/server/sdom.serialize function in riot

To help you get started, we’ve selected a few riot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ilearnio / riot-ssr / index.js View on Github external
function _render (tag) {
  var html = sdom.serialize(tag.root)

  // unmount the tag avoiding memory leaks
  tag.unmount()

  return html
}
github cheft / riot-isomorphic-template / lib / server.js View on Github external
riot.render = function(tagName, opts) {
        var root = document.createElement(tagName);
        var tag = riot.mount(root, opts);
        if(tag && tag[0].done) {
            return {tag: tag[0], root: root, dom: function(root) {
                return sdom.serialize(root);
            }};
        }else {
            return sdom.serialize(root);
        }
    };
github cheft / riot-isomorphic-template / lib / server.js View on Github external
return {tag: tag[0], root: root, dom: function(root) {
                return sdom.serialize(root);
            }};
        }else {