How to construct subclasses of Immutable.Record?
问题 class Event extends Immutable.Record { constructor(text) { super({text: text, timestamp: Date.now()}); } } Calling new Event() seems to return a constuctor function: new Event('started').toString() "function Record(values){ if(values instanceof RecordType){ return values;} if(!(this instanceof RecordType)){ return new RecordType(values);} if(!hasInitialized){ hasInitialized=true; var keys=Object.keys(defaultValues); setProps(RecordTypePrototype,keys); RecordTypePrototype.size=keys.length;