Skip to content

Commit

Permalink
removed unused methods, reworked subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 23, 2024
1 parent aa4f52a commit e2895a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
22 changes: 16 additions & 6 deletions repository/OpenPonk-Model/OPAnnouncableObject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ OPAnnouncableObject >> announceRemoved: anElement [

{ #category : 'accessing' }
OPAnnouncableObject >> announcer [
announcer ifNil: [ self announcer: Announcer new ].
^ announcer
]

{ #category : 'accessing' }
OPAnnouncableObject >> announcer: anAnnouncer [
announcer := anAnnouncer
^ announcer ifNil: [ announcer := Announcer new ]
]

{ #category : 'announcing' }
Expand Down Expand Up @@ -78,6 +73,21 @@ OPAnnouncableObject >> unsubscribe: anObject [
^ self announcer unsubscribe: anObject
]

{ #category : 'announcement registration' }
OPAnnouncableObject >> weakWhen: anAnnouncementClass send: aSelector to: aReceiver [

^ self announcer weak
when: anAnnouncementClass
send: aSelector
to: aReceiver
]

{ #category : 'announcement registration' }
OPAnnouncableObject >> weakWhenChangedSend: aSelector to: aReceiver [

^ self weakWhen: OPElementChanged send: aSelector to: aReceiver
]

{ #category : 'announcement registration' }
OPAnnouncableObject >> when: anAnnouncementClass do: aValuable [

Expand Down
3 changes: 1 addition & 2 deletions repository/OpenPonk-Model/OPModelObject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ OPModelObject >> add: anElement [
(elements includes: anElement) ifTrue: [ ^ anElement ].
anElement addedTo: self.
elements add: anElement.
anElement when: OPElementChanged send: #changed to: self.
anElement weakWhen: OPElementChanged send: #changed to: self.
self announceAdded: anElement.
^ anElement
]
Expand Down Expand Up @@ -140,7 +140,6 @@ OPModelObject >> remove [
OPModelObject >> remove: anElement [

(elements includes: anElement) ifFalse: [ ^ anElement ].
anElement unsubscribe: self.
anElement removeFrom: self.
elements remove: anElement.
self announceRemoved: anElement.
Expand Down

0 comments on commit e2895a9

Please sign in to comment.