static fromJS()

in src/model/immutable/EditorState.js [161:198]


  static fromJS(config: EditorStateCreationConfigRawType): EditorState {
    return new EditorState(
      new EditorStateRecord({
        ...config,
        directionMap:
          config.directionMap != null
            ? OrderedMap(config.directionMap)
            : config.directionMap,
        inlineStyleOverride:
          config.inlineStyleOverride != null
            ? OrderedSet(config.inlineStyleOverride)
            : config.inlineStyleOverride,
        nativelyRenderedContent:
          config.nativelyRenderedContent != null
            ? ContentState.fromJS(config.nativelyRenderedContent)
            : config.nativelyRenderedContent,
        redoStack:
          config.redoStack != null
            ? Stack(config.redoStack.map(v => ContentState.fromJS(v)))
            : config.redoStack,
        selection:
          config.selection != null
            ? new SelectionState(config.selection)
            : config.selection,
        treeMap:
          config.treeMap != null
            ? OrderedMap(config.treeMap).map(v =>
                List(v).map(v => BlockTree.fromJS(v)),
              )
            : config.treeMap,
        undoStack:
          config.undoStack != null
            ? Stack(config.undoStack.map(v => ContentState.fromJS(v)))
            : config.undoStack,
        currentContent: ContentState.fromJS(config.currentContent),
      }),
    );
  }