Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Make 'decorator' optional and allow null consistenly in EditorState (#…
Browse files Browse the repository at this point in the history
…920)

This fixes a minor flow error coming up in a FB use case, and makes the
overall typing more consistent in this file.
  • Loading branch information
flarnie authored Jan 27, 2017
1 parent 6344031 commit dba0c42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/model/immutable/EditorState.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class EditorState {
_immutable: EditorStateRecord;

static createEmpty(
decorator?: DraftDecoratorType
decorator?: ?DraftDecoratorType
): EditorState {
return EditorState.createWithContent(
ContentState.createFromText(''),
Expand All @@ -79,7 +79,7 @@ class EditorState {

static createWithContent(
contentState: ContentState,
decorator?: DraftDecoratorType
decorator?: ?DraftDecoratorType
): EditorState {
var firstKey = contentState.getBlockMap().first().getKey();
return EditorState.create({
Expand Down Expand Up @@ -516,7 +516,7 @@ function updateSelection(
*/
function generateNewTreeMap(
contentState: ContentState,
decorator: ?DraftDecoratorType
decorator?: ?DraftDecoratorType
): OrderedMap<string, List<any>> {
return contentState
.getBlockMap()
Expand All @@ -533,7 +533,7 @@ function regenerateTreeForNewBlocks(
editorState: EditorState,
newBlockMap: BlockMap,
newEntityMap: EntityMap,
decorator: ?DraftDecoratorType
decorator?: ?DraftDecoratorType
): OrderedMap<string, List<any>> {
const contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);
var prevBlockMap = contentState.getBlockMap();
Expand Down

0 comments on commit dba0c42

Please sign in to comment.