Skip to content

Commit

Permalink
feat: #413 add ViewModel.$bulkSavePreview
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Aug 23, 2024
1 parent 03affc6 commit 3ca6663
Show file tree
Hide file tree
Showing 3 changed files with 315 additions and 269 deletions.
12 changes: 12 additions & 0 deletions docs/stacks/vue/layers/viewmodels.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ For the response to a bulk save, the server will load and return the root ViewMo
@[import-md "start":"export interface BulkSaveOptions", "end":"\n}\n", "prepend":"``` ts", "append":"```"](../../../../src/coalesce-vue/src/viewmodel.ts)
<Prop def="$bulkSavePreview(options?: BulkSaveOptions) => {
isDirty: boolean;
errors: string[];
items: BulkSaveRequestItem[];
rawItems: BulkSaveRequestRawItem[];
}" lang="ts" />
Returns the payload that will be used for the `$bulkSave` operation.
Useful for driving UI state, like preemptively showing errors, or determining if there are any objects with pending modifications. If you are using this to drive UI state, it is strongly recommended to wrap this call in a `computed` in your component to reduce excessive invocations.
<Prop def="$remove(): void" lang="ts" />
Removes the item from its parent collection (if it is in a collection), and marks the item for deletion in the next bulk save.
Expand Down
Loading

0 comments on commit 3ca6663

Please sign in to comment.