@webamoki/web-svelte 2.5.3 → 2.6.0

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.
@@ -20,7 +20,10 @@ export declare class CommandAction<S, O extends CommandSuccess> {
20
20
  toastError?: boolean;
21
21
  toastSuccess?: boolean;
22
22
  });
23
+ /** Executes the command with the current input. */
23
24
  execute(): Promise<void>;
25
+ /** Executes the command with the provided input. */
26
+ executeWith(input: S): Promise<void>;
24
27
  }
25
28
  type RCV<O extends CommandSuccess> = RemoteCommand<void, Promise<CommandResult<O>>>;
26
29
  /**
@@ -26,10 +26,14 @@ export class CommandAction {
26
26
  this.#onError = config?.onError;
27
27
  this.#onSuccess = config?.onSuccess;
28
28
  }
29
- async execute() {
29
+ /** Executes the command with the current input. */
30
+ execute() {
31
+ return this.executeWith(this.input);
32
+ }
33
+ /** Executes the command with the provided input. */
34
+ async executeWith(input) {
30
35
  this.#submitCount++;
31
36
  try {
32
- const input = this.input;
33
37
  const result = await this.#remote(input).catch(() => Result.err({ code: 500, message: 'Internal Server Error' }));
34
38
  if (result.ok) {
35
39
  if (this.#toastSuccess)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "2.5.3",
7
+ "version": "2.6.0",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",