Skip to content

Commit

Permalink
Update code review checklist regarding disposal, see #224
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jul 30, 2024
1 parent 0e1e629 commit 922dbb2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions checklists/code-review-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ If any of these items fail, pause code review.
by `ObservableArrayDef.element*Emitter.removeListener`
* SCENERY: `Node.addInputListener` is accompanied by `removeInputListener`
* TANDEM: Creation of an instrumented `PhetioObject` is accompanied by `dispose`.
- [ ] All classes that require a `dispose` function should have one. This should expose a public `dispose` function that
calls `this.dispose{{CLASS_NAME}}()`, where `dispose{{CLASS_NAME}}` is a private function declared in the
constructor. `{{CLASS_NAME}}` should exactly match the class name.
- [ ] All classes that require a `dispose` function should have one. There are many reasonable ways to implement
`dispose`, including but not limited to: (a) declaring a private function like `this.dispose{{CLASS_NAME}}()` in
the constructor, where `{{CLASS_NAME}}` should exactly match the class name. (b) Using Disposable.ts/disposeEmitter,
(c) calling `super.dispose()` and `myChild.dispose()` etc.
- [ ] All classes that do not properly override `dispose` should either (a) use `isDisposable: false`, or (b) implement
a `dispose` method that calls `Disposable.assertNotDisposable`. Use (a) for classes that inherit a `dispose` method
from Disposable. Use (b) for classes that inherit a `dispose` method from something other than Disposable. The goal
Expand Down

0 comments on commit 922dbb2

Please sign in to comment.