Skip to content
Snippets Groups Projects
Commit 5e34a35a authored by Chris Beer's avatar Chris Beer
Browse files

Extract MiradorViewer#render

parent 5bf3996b
No related branches found
No related tags found
No related merge requests found
......@@ -14,16 +14,25 @@ class MiradorViewer {
/**
*/
constructor(config, viewerConfig = {}) {
this.plugins = filterValidPlugins(viewerConfig.plugins);
this.plugins = filterValidPlugins(viewerConfig.plugins || []);
this.config = config;
this.store = viewerConfig.store
|| createPluggableStore(this.config, this.plugins);
config.id && ReactDOM.render(
this.render(),
document.getElementById(config.id),
);
}
/**
* Render the mirador viewer
*/
render() {
return (
<Provider store={this.store}>
<HotApp plugins={this.plugins} />
</Provider>,
document.getElementById(config.id),
</Provider>
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment