1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-18 13:11:17 +02:00

Switched Map to fromJS in order to convert the whole js object (also nested data structures) to immutable (#2619)

Looks like a worthwhile improvement to me @delijah and thanks for contributing the PR. Given that nested data structures are permissible this improved the ease of use.
This commit is contained in:
delijah
2019-03-11 05:32:36 +01:00
committed by Sunny Hirai
parent 5347fe1f3a
commit b8c372df93

View File

@@ -1,5 +1,5 @@
import isPlainObject from 'is-plain-object'
import { List, Map, Record } from 'immutable'
import { fromJS, List, Record } from 'immutable'
import KeyUtils from '../utils/key-utils'
import Node from './node'
@@ -88,7 +88,7 @@ class Block extends Record(DEFAULTS) {
const block = new Block({
key,
type,
data: Map(data),
data: fromJS(data),
nodes: Node.createList(nodes),
})