revertLastLayoutChange()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
A convenience function to create UndoLayoutChanges command that will revert the very last command and toss it out of history.
export declare function revertLastLayoutChange(correlationId?: string): IUndoLayoutChanges;
Parameters
Parameter | Type | Description |
|---|---|---|
correlationId | string | (Optional) specify correlation id to use for this command. this will be included in all events that will be emitted during the command processing |
Returns
Remarks
This is useful if you are implementing complex and cancellable interactions. For instance if you are building drag-and-drop interaction which upon drag start removes item from a section using the RemoveSectionItem command and upon drop places item in a new location using AddSectionItems command.
When the user starts drag, you submit the RemoveSectionItem command (keeping the item in stash). Then user does something to cancel the interaction: you need to restore the layout to the original state: that means to revert the last layout change that was done by your interaction.