Skip to content
Snippets Groups Projects
Commit f9333cf8 authored by chris's avatar chris
Browse files

fix multiple config instances

parent e807867d
No related branches found
No related tags found
1 merge request!199fix multiple config instances
......@@ -66,7 +66,7 @@ export default class Application {
static create(config) {
/* Merge Core Config with User Config */
const appConfig = deepmerge({ config: defaultConfig }, config, {
const appConfig = deepmerge({ config: defaultConfig() }, config, {
customMerge: key => {
if (key === 'services') {
return (coreService, configService) => {
......
......@@ -31,10 +31,9 @@ const serializer = schema => {
};
};
let schema;
const createApplication = props => {
const application = Application.create(props);
schema = application.getSchema();
application.getSchema();
application.bootServices();
return application;
};
......@@ -68,7 +67,7 @@ const Wax = props => {
} = props;
if (!application) return null;
const { schema } = application.schema;
const WaxOnchange = onChange ? onChange : value => true;
const editorContent = value || '';
......@@ -88,7 +87,7 @@ const Wax = props => {
const finalOnChange = debounce(
value => {
/*HACK alter toDOM of footnote, because of how PM treats inline nodes
/* HACK alter toDOM of footnote, because of how PM treats inline nodes
with content */
if (schema.nodes.footnote) {
const old = schema.nodes.footnote.spec.toDOM;
......
......@@ -7,7 +7,7 @@ import {
OverlayService,
} from 'wax-prosemirror-services';
export default {
export default () => ({
services: [
new SchemaService(),
new RulesService(),
......@@ -16,4 +16,4 @@ export default {
new MenuService(),
new OverlayService(),
],
};
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment