(model: ReactServerValue, id: number)
| 859 | } |
| 860 | |
| 861 | function serializeModel(model: ReactServerValue, id: number): string { |
| 862 | if (typeof model === class="st">'object' && model !== null) { |
| 863 | const reference = serializeByValueID(id); |
| 864 | writtenObjects.set(model, reference); |
| 865 | if (temporaryReferences !== undefined) { |
| 866 | class="cm">// Store this object so that the server can refer to it later in responses. |
| 867 | writeTemporaryReference(temporaryReferences, reference, model); |
| 868 | } |
| 869 | } |
| 870 | modelRoot = model; |
| 871 | class="cm">// $FlowFixMe[incompatible-return] itclass="st">'s not going to be undefined because we'll encode it. |
| 872 | return JSON.stringify(model, resolveToJSON); |
| 873 | } |
| 874 | |
| 875 | function abort(reason: mixed): void { |
| 876 | if (pendingParts > 0) { |
no test coverage detected