Skip to content

Commit

Permalink
Make callActivate reusable (#180 #501)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Nov 10, 2021
1 parent b6054d8 commit 513e448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions frontend/src/core/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export default class View<M extends Model = Model> extends BView<M> {
}
}

// Helper function in support of the activate convention (see above).
export const callActivate = view => view.activate();

/**
* CompositeView derives both from our own customized View base class
* and from the BCompositeView we imported from backbone-fractal.
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/hierarchy/hierarchy-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import Collection from '../core/collection';
import View, {
CompositeView,
CollectionView,
callActivate,
ViewOptions as BViewOptions,
} from '../core/view';

Expand Down Expand Up @@ -109,8 +110,6 @@ export interface ViewOptions<
recursive?: typeof CollectionView;
}

// Helper function in support of the activate convention (see ../core/view).
const callActivate = view => view.activate();
// Options are passed down the hierarchy. To prevent a model or collection from
// a higher level from lingering around, we reset those options using the mask
// below before recursing into the next outer model.
Expand Down

0 comments on commit 513e448

Please sign in to comment.