             to: #selector(NSOutlineViewDataSource.outlineView(_:numberOfChildrenOfItem:)),
             map: { (dataSource: Element.UnderlyingCollection?, _: NSOutlineView, item: Element.UnderlyingCollection?) -> Int in
                 guard let dataSource = dataSource else { return 0 }
-                return item?.children.count ?? dataSource.count // TODO check if this is correct
+                return item?.children.count ?? dataSource.count
+            }
+        )
+
+        disposable += outlineView.reactive.dataSource.feed(
+            property: dataSource,
+            to: #selector(NSOutlineViewDataSource.outlineView(_:child:ofItem:)),
+            map: { (dataSource: Element.UnderlyingCollection?, _: NSOutlineView, child: Int, item: Element.UnderlyingCollection?) -> Any in
+                guard let item = item else {
+                    // If item is nil, then we return the child from the root node
+                    return dataSource![IndexPath(index: child)]
+                }
+
+                // otherwise return item's child
+                return item[IndexPath(index: child)]
+            }
+        )
+
+        disposable += outlineView.reactive.dataSource.feed(
+            property: dataSource,
+            to: #selector(NSOutlineViewDataSource.outlineView(_:isItemExpandable:)),
+            map: { (dataSource: Element.UnderlyingCollection?, outlineView: NSOutlineView, item: Element.UnderlyingCollection?) -> Bool in
+                guard let dataSource = dataSource else { return false }
+                return binder.isExpandable(for: item?.value, outlineView: outlineView, dataSource: dataSource)
             }
         )
 

    }
}


public extension SignalProtocol where Element: ObservableCollectionEventProtocol, Element.UnderlyingCollection: TreeNodeProtocol, Error == NoError {

    @discardableResult
    public func bind(to outlineView: NSOutlineView, animated: Bool = true, createCell: @escaping (Element.UnderlyingCollection, Element.UnderlyingCollection.Value?, NSTableColumn?, NSOutlineView) -> NSView?) -> Disposable {
        let binder = OutlineViewBinder(measureCell: nil, createCell: createCell)

    public var insertAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]
    public var deleteAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]

    let isItemExpandable: ((TreeNode, TreeNode.Value?, NSOutlineView) -> Bool)?
    let measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)?
    let createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)?

    public init() {
        // This initializer allows subclassing without having to declare default initializer in subclass.
        self.isItemExpandable = nil
        self.measureCell = nil
        self.createCell = nil
    }

    public init(isItemExpandable: ((TreeNode, TreeNode.Value?, NSOutlineView) -> Bool)? = nil, measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)? = nil, createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)? = nil) {
        self.isItemExpandable = isItemExpandable
        self.measureCell = measureCell
        self.createCell = createCell
    }

    open func isExpandable(for item: TreeNode.Value?, outlineView: NSOutlineView, dataSource: TreeNode) -> Bool {
        return self.isItemExpandable?(dataSource, item, outlineView) ?? false
    }

    open func height(for item: TreeNode.Value?, outlineView: NSOutlineView, dataSource: TreeNode) -> CGFloat? {
