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

Commit

Permalink
7.C - Block Operations - Consume
Browse files Browse the repository at this point in the history
Summary: Making the `createContentBlockFromJS` in `ContentState` public for re-usability.

Differential Revision: D21064309

fbshipit-source-id: bbbd6415631401c1cda91b58152a5e7b46d5ce05
  • Loading branch information
shalabhvyas authored and facebook-github-bot committed Apr 23, 2020
1 parent 0585b68 commit 99c6b06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/model/immutable/ContentState.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const defaultRecord: ContentStateRecordType = {

const ContentStateRecord = (Record(defaultRecord): any);

/* $FlowFixMe Supressing a `signature-verification-failure` error here.
* TODO: T65949050 Clean up the branch for this GK
*/
const ContentBlockNodeRecord = gkx('draft_tree_data_support')
? ContentBlockNode
: ContentBlock;
Expand Down Expand Up @@ -234,14 +237,14 @@ class ContentState extends ContentStateRecord {
return new ContentState({
...state,
blockMap: OrderedMap(state.blockMap).map(
ContentState._createContentBlockFromRaw,
ContentState.createContentBlockFromJS,
),
selectionBefore: new SelectionState(state.selectionBefore),
selectionAfter: new SelectionState(state.selectionAfter),
});
}

static _createContentBlockFromRaw(
static createContentBlockFromJS(
block: BlockNodeRawConfig,
): ContentBlockNodeRecord {
const characterList = block.characterList;
Expand Down

0 comments on commit 99c6b06

Please sign in to comment.