This commit is contained in:
41
node_modules/apollo-client/data/mutations.js
generated
vendored
Normal file
41
node_modules/apollo-client/data/mutations.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var MutationStore = (function () {
|
||||
function MutationStore() {
|
||||
this.store = {};
|
||||
}
|
||||
MutationStore.prototype.getStore = function () {
|
||||
return this.store;
|
||||
};
|
||||
MutationStore.prototype.get = function (mutationId) {
|
||||
return this.store[mutationId];
|
||||
};
|
||||
MutationStore.prototype.initMutation = function (mutationId, mutation, variables) {
|
||||
this.store[mutationId] = {
|
||||
mutation: mutation,
|
||||
variables: variables || {},
|
||||
loading: true,
|
||||
error: null,
|
||||
};
|
||||
};
|
||||
MutationStore.prototype.markMutationError = function (mutationId, error) {
|
||||
var mutation = this.store[mutationId];
|
||||
if (mutation) {
|
||||
mutation.loading = false;
|
||||
mutation.error = error;
|
||||
}
|
||||
};
|
||||
MutationStore.prototype.markMutationResult = function (mutationId) {
|
||||
var mutation = this.store[mutationId];
|
||||
if (mutation) {
|
||||
mutation.loading = false;
|
||||
mutation.error = null;
|
||||
}
|
||||
};
|
||||
MutationStore.prototype.reset = function () {
|
||||
this.store = {};
|
||||
};
|
||||
return MutationStore;
|
||||
}());
|
||||
exports.MutationStore = MutationStore;
|
||||
//# sourceMappingURL=mutations.js.map
|
||||
Reference in New Issue
Block a user