(reason: mixed)
| 873 | } |
| 874 | |
| 875 | function abort(reason: mixed): void { |
| 876 | if (pendingParts > 0) { |
| 877 | pendingParts = 0; // Don't resolve again later. |
| 878 | // Resolve with what we have so far, which may have holes at this point. |
| 879 | // They'll error when the stream completes on the server. |
| 880 | if (formData === null) { |
| 881 | resolve(json); |
| 882 | } else { |
| 883 | resolve(formData); |
| 884 | } |
| 885 | } |
| 886 | } |
| 887 | |
| 888 | const json = serializeModel(root, 0); |
| 889 |