code: function (renderer, tagName) {
              tagName = tagName || "div";
              if (typeof renderer === "function") {
                  return function (data, container) {
                      if (container) {
                          container.appendChild(renderer(data));
                          return container;
                      } else {
                          return renderer(data);
                      }
                  };
              }
  
              var template;
              if (typeof renderer.render === "function") {
                  template = renderer;
              } else if (renderer.winControl && typeof renderer.winControl.render === "function") {
                  template = renderer.winControl;
              }
  
              return function (data, container) {
                  var host = container || _Global.document.createElement(tagName);
                  template.render(data, host);
                  if (container) {
                      return container;
                  } else {
                      // The expectation is that the creation of the DOM elements happens synchronously
                      //  and as such we steal the first child and make it the root element.
                      //
                      var element = host.firstElementChild;
  
                      // Because we have changed the "root" we may need to move the dispose method
                      //  created by the template to the child and do a little switcheroo on dispose.
                      //
                      if (element && host.dispose) {
                          var prev = element.dispose;
                          element.dispose = function () {
                              element.dispose = prev;
                              host.appendChild(element);
                              host.dispose();
                          };
                      }
                      return element;
                  }
              };
          }
docs: Take a renderer which may be a function (signature: (data) => element) or a WinJS.Binding.Template and return a function with a unified synchronous contract which is:  (data, container) => element  Where:  1) if you pass container the content will be rendered into the container and the container will be returned.  2) if you don't pass a container the content will be rendered and returned.