diff --git a/app/composables/ving/useVingKind.mjs b/app/composables/ving/useVingKind.mjs index 5630498f..49fcd867 100644 --- a/app/composables/ving/useVingKind.mjs +++ b/app/composables/ving/useVingKind.mjs @@ -216,6 +216,7 @@ class VingKind { /** * Frees the memory associated with the list of records + * @returns {object} The current instance of this kind. * @example * onBeforeRouteLeave(() => users.dispose()); */ @@ -223,7 +224,8 @@ class VingKind { for (const record of this.records) { record.dispose(); } - this.reset(); + this.records.splice(0); + return this; } /** @@ -404,18 +406,6 @@ class VingKind { } } - /** - * Locally empties the `records` array. - * - * @returns {object} A reference to this object for chaining - * @example - * users.reset() - */ - reset() { - this.records.splice(0); - return this; - } - /** * Sets the `new` property back to its default state. Something you usually want to do after you create a new record. * @example @@ -448,7 +438,7 @@ class VingKind { if (!response.error) { const data = response.data; if (options.accumulate != true) { - this.reset(); + this.dispose(); } for (let index = 0; index < data.items.length; index++) { this.append({ id: data.items[index].props.id, ...data.items[index] }, options); diff --git a/ving/docs/change-log.md b/ving/docs/change-log.md index 3558ae3e..a1a9dbf9 100644 --- a/ving/docs/change-log.md +++ b/ving/docs/change-log.md @@ -12,6 +12,7 @@ outline: deep * Added error handling to verifyExtension() in S3File. * Added validation for acceptedFileExtensions in ving schemas being in the wrong place. * Make ioredis quit gracefully. + * useVingKind().reset() is removed. Use .dispose() instead. ### 2024-10-24 * Installed dotenv for environment variables.