UNPKG

@20minutes/draft-convert

Version:

Extensibly serialize & deserialize Draft.js ContentState

8 lines (7 loc) 250 B
export default ((typeObject)=>(block)=>{ if (typeof typeObject === 'function') { // handle case where typeObject is already a function return typeObject(block); } return typeObject[block.type]; });