code: function destroy(publicAPI, model = {}) {
    const previousDestroy = publicAPI.destroy;
  
    if (!model.subscriptions) {
      model.subscriptions = [];
    }
  
    publicAPI.destroy = () => {
      if (previousDestroy) {
        previousDestroy();
      }
      while (model.subscriptions && model.subscriptions.length) {
        model.subscriptions.pop().unsubscribe();
      }
      Object.keys(model).forEach((field) => {
        delete model[field];
      });
  
      // Flag the instance beeing deleted
      model.deleted = true;
    };
  }
docs: ---------------------------------------------------------------------------- Add destroy function ----------------------------------------------------------------------------