Skip to content

1.0.0-beta.28 (@scion/workbench-client)

Compare
Choose a tag to compare
@github-actions github-actions released this 25 Nov 15:41
· 6 commits to master since this release

1.0.0-beta.28 (2024-11-25)

Features

  • workbench-client/view: add functional CanClose guard, deprecate class-based guard (ecd52b3)

Deprecations

  • workbench-client/view: The class-based CanClose guard has been deprecated in favor of a functional guard that can be registered on WorkbenchView.canClose.

    Migrate by registering a callback on WorkbenchView.canClose instead of implementing the CanClose interface.

    Before migration:

    import {CanClose, WorkbenchView} from '@scion/workbench-client';
    import {Beans} from '@scion/toolkit/bean-manager';
    
    export class ViewComponent implements CanClose {
    
      constructor() {
        Beans.get(WorkbenchView).addCanClose(this);
      }
    
      public canClose(): boolean {
        return true;
      }
    }

    After migration:

    import {WorkbenchView} from '@scion/workbench-client';
    import {Beans} from '@scion/toolkit/bean-manager';
    
    export class ViewComponent {
    
      constructor() {
        Beans.get(WorkbenchView).canClose(() => {
          return true;
        });
      }
    }