refactoring

This commit is contained in:
Philipp Kühn 2018-09-28 13:55:34 +02:00
parent 5f740da53e
commit d089259080

View File

@ -8,11 +8,7 @@ export default function (pos, type, attrs = {}) {
}
if (dispatch) {
// const transform = state.tr
// .replaceWith(pos.from, pos.to, state.schema.nodes.mention.create({ id: 2, type: 'user', label: 'loool' }))
const transform = state.tr.replaceWith(pos.from, pos.to, type.create(attrs))
dispatch(transform)
dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs)))
}
return true