How to use the mithril.mount function in mithril

To help you get started, we’ve selected a few mithril 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 ArthurClemens / polythene / packages / tests-bundle-mithril-individual / src / index.js View on Github external
onclick: () => Snackbar.show({
                  /* note the Snackbar component is below the other elements in the app */
                  title: "Hello"
                })
              }
            })
          )
        ]
      ),
      m(Dialog),
      m(Snackbar),
      m(Notification)
    ])
};

m.mount(document.querySelector("#root"), App);
github caleb531 / connect-four / test / ui / fixtures.js View on Github external
export function _afterEach() {
  m.mount(qs('main'), null);
}
github gocd / gocd / server / webapp / WEB-INF / rails.new / spec / webpack / views / auth_configs / auth_configs_widget_spec.js View on Github external
afterEach(() => {
    jasmine.Ajax.uninstall();

    m.mount(root, null);
    m.redraw();

    expect($('.new-modal-container .reveal')).not.toExist('Did you forget to close the modal before the test?');
  });
github gocd / gocd / server / webapp / WEB-INF / rails.new / spec / webpack / views / pipeline_configs / edit_pluggable_scm_material_widget_spec.js View on Github external
function mount(scmId, material) {
    m.mount(root, {
      view() {
        return m(EditPluggableSCMMaterialWidget, {
          scmId:       Stream(scmId),
          material,
          pluginInfos: Stream(PluginInfos.fromJSON(pluginInfosJSON))
        });
      }
    });
    m.redraw();
  }
github gocd / gocd / server / webapp / WEB-INF / rails.new / spec / webpack / views / agents / resources_list_widget_spec.js View on Github external
const mount = (resources) => {
    m.mount(root, {
      view() {
        return m(ResourcesListWidget, {
          hideDropDown,
          dropDownReset,
          resourcesFetchError,
          'onResourcesUpdate': Stream(),
          'resources':         Stream(resources)
        });
      }
    });

    m.redraw();
  };
github FallenMax / notepad.cc / src / client / index.ts View on Github external
onBlur,
                }),
              ]),
            ]),
          ]),
        ]),
        m(
          'footer',
          m('small', m('a.this-page', { href }, decodeURIComponent(href))),
        ),
      ])
    },
  }
}

m.mount(document.body, App)
github browserpass / browserpass-extension / src / popup.src.js View on Github external
function render() {
    var body = document.getElementsByTagName("body")[0];
    Mithril.mount(body, {
        view: function() {
            return [renderError(), renderNotice(), renderList()];
        }
    });
    checkpoint("after render");
}
github vrimar / construct-ui / src / components / dialog / index.spec.ts View on Github external
function mount(attrs: IDialogAttrs) {
    const component = {
      view: () => m(Dialog, {
        isOpen: true,
        ...attrs
      })
    };

    m.mount(document.body, component);
  }
});
github vrimar / construct-ui / src / components / query-list / index.spec.ts View on Github external
afterEach(() => {
    document.body.innerHTML = '';
    m.mount(document.body, null);
  });