Skip to content

Commit

Permalink
Employed ObservableArray.count for phetsims/axon#279
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhTotey authored and SaurabhTotey committed May 18, 2020
1 parent 6c59ad6 commit b447275
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/prisms/view/PrismToolboxNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PrismToolboxNode extends Node {
const prismIcon = createPrismIcon( prism );

const listener = () => {
const count = _.filter( prismsModel.prisms.getArray(), p => p.typeName === prism.typeName ).length;
const count = prismsModel.prisms.count( p => p.typeName === prism.typeName );
prismIcon.visible = count < MAX_PRISM_COUNT;
};
prismsModel.prisms.addItemAddedListener( listener );
Expand Down Expand Up @@ -247,4 +247,4 @@ class PrismToolboxNode extends Node {

bendingLight.register( 'PrismToolboxNode', PrismToolboxNode );

export default PrismToolboxNode;
export default PrismToolboxNode;

0 comments on commit b447275

Please sign in to comment.