code: function (context, payload) {
          var state = context.state;
          var entity = state.$name;
          // If the payload is an array, then the payload should be an array of
          // data so let's pass the whole payload as data.
          if (Array.isArray(payload)) {
              return context.dispatch(state.$connection + "/update", { entity: entity, data: payload }, { root: true });
          }
          // If the payload doesn't have `data` property, we'll assume that
          // the user has passed the object as the payload so let's define
          // the whole payload as a data.
          if (payload.data === undefined) {
              return context.dispatch(state.$connection + "/update", { entity: entity, data: payload }, { root: true });
          }
          // Else destructure the payload and let root action handle it.
          return context.dispatch(state.$connection + "/update", __assign({ entity: entity }, payload), { root: true });
      }
docs: Update data in the store.