Poll: Need opinions on new features #18

Closed
opened 2025-12-29 15:22:08 +01:00 by adam · 2 comments
Owner

Originally created by @JohnEstropia on GitHub (Nov 20, 2015).

CoreStore's features right now are mostly ones that I needed on Swift projects I have been involved
with so far, but I am curious as to what features other apps may be looking for.

I've thought of a few, you can vote for them here: http://goo.gl/RIiHMP
I'd appreciate any suggestions in this thread as well :)

Originally created by @JohnEstropia on GitHub (Nov 20, 2015). CoreStore's features right now are mostly ones that I needed on Swift projects I have been involved with so far, but I am curious as to what features other apps may be looking for. I've thought of a few, you can vote for them here: http://goo.gl/RIiHMP I'd appreciate any suggestions in this thread as well :)
adam added the help wanted label 2025-12-29 15:22:08 +01:00
adam closed this issue 2025-12-29 15:22:08 +01:00
Author
Owner

@vburojevic commented on GitHub (Nov 22, 2015):

Hi! Nice work so far on CoreStore!

I tried to implement an extension for RxSwift to wrap ListMonitor delegate, but can't because ListObserver protocol has a generic constraint. Any ideas how to get around this? It would be possible if ListMonitor had a delegate property of AnyObject type.

Please refer to example here:
https://github.com/ReactiveX/RxSwift/#delegates

@vburojevic commented on GitHub (Nov 22, 2015): Hi! Nice work so far on CoreStore! I tried to implement an extension for RxSwift to wrap ListMonitor delegate, but can't because ListObserver protocol has a generic constraint. Any ideas how to get around this? It would be possible if ListMonitor had a delegate property of AnyObject type. Please refer to example here: https://github.com/ReactiveX/RxSwift/#delegates
Author
Owner

@JohnEstropia commented on GitHub (Nov 22, 2015):

@vburojevic From my understanding, RX's support for "delegates" is designed for cocoa's id delegate paradigm (i.e. typeless), which is really against ListMonitor's purpose. I think by creating a custom ListObserver classthat

  1. stores an ObserverOf<(ListEntityType, NSIndexPath)> property
  2. implements all ListObserver methods and calls
self.observer.on(.Next(.Update /* or .Move etc.*/(object, indexPath)))

in each method with the corresponding RxEvent,

You can probably write an extension on ListMonitor:

extension ListMonitor {
// ...
func rx_inserted(...) -> Observable<(ListEntityType, NSIndexPath)>
func rx_updated(...) -> Observable<(ListEntityType, NSIndexPath)>
func rx_deleted(...) -> Observable<(ListEntityType, NSIndexPath)>

I haven't thought about it too much yet, but if RX is to be supported internally by CoreStore I'm thinking implementing PublishSubject on ListMonitor makes the most sense. I might be wrong though (I just started using RXSwift this week).

If you'd like to continue this discussion, you can create a separate issue for it :)

@JohnEstropia commented on GitHub (Nov 22, 2015): @vburojevic From my understanding, RX's support for "delegates" is designed for cocoa's `id delegate` paradigm (i.e. typeless), which is really against `ListMonitor`'s purpose. I think by creating a custom `ListObserver` classthat 1. stores an `ObserverOf<(ListEntityType, NSIndexPath)>` property 2. implements all `ListObserver` methods and calls ``` swift self.observer.on(.Next(.Update /* or .Move etc.*/(object, indexPath))) ``` in each method with the corresponding `RxEvent`, You can probably write an extension on `ListMonitor`: ``` swift extension ListMonitor { // ... func rx_inserted(...) -> Observable<(ListEntityType, NSIndexPath)> func rx_updated(...) -> Observable<(ListEntityType, NSIndexPath)> func rx_deleted(...) -> Observable<(ListEntityType, NSIndexPath)> ``` I haven't thought about it too much yet, but if RX is to be supported _internally_ by CoreStore I'm thinking implementing `PublishSubject` on `ListMonitor` makes the most sense. I might be wrong though (I just started using RXSwift this week). If you'd like to continue this discussion, you can create a separate issue for it :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#18