relay-runtime 0.0.0-main-d6ee090a → 0.0.0-main-9b2ef544
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -87,6 +87,8 @@ function commitMutation(environment, config) {
|
|
|
87
87
|
uploadables: uploadables
|
|
88
88
|
}).subscribe({
|
|
89
89
|
next: function next(payload) {
|
|
90
|
+
var _config$onNext;
|
|
91
|
+
|
|
90
92
|
if (Array.isArray(payload)) {
|
|
91
93
|
payload.forEach(function (item) {
|
|
92
94
|
if (item.errors) {
|
|
@@ -98,6 +100,8 @@ function commitMutation(environment, config) {
|
|
|
98
100
|
errors.push.apply(errors, (0, _toConsumableArray2["default"])(payload.errors));
|
|
99
101
|
}
|
|
100
102
|
}
|
|
103
|
+
|
|
104
|
+
(_config$onNext = config.onNext) === null || _config$onNext === void 0 ? void 0 : _config$onNext.call(config);
|
|
101
105
|
},
|
|
102
106
|
complete: function complete() {
|
|
103
107
|
var onCompleted = config.onCompleted;
|
|
@@ -60,6 +60,7 @@ export type MutationConfig<T: MutationParameters> = {|
|
|
|
60
60
|
response: $ElementType<T, 'response'>,
|
|
61
61
|
errors: ?Array<PayloadError>,
|
|
62
62
|
) => void,
|
|
63
|
+
onNext?: ?() => void,
|
|
63
64
|
onUnsubscribe?: ?() => void,
|
|
64
65
|
optimisticResponse?: $ElementType<
|
|
65
66
|
{
|
|
@@ -154,6 +155,7 @@ function commitMutation<T: MutationParameters>(
|
|
|
154
155
|
errors.push(...payload.errors);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
158
|
+
config.onNext?.();
|
|
157
159
|
},
|
|
158
160
|
complete: () => {
|
|
159
161
|
const {onCompleted} = config;
|