 
 //MARK: Associated properties
 
-// lazily creates a gettable associated property via the given factory
+/**
+ * Create associated property with given host.
+ * Subsequent calls with the same host and key return the same associated objects.
+ *
+ * - parameter host: Host of the newly created property
+ * - parameter key: Key with which the newly created property will be associated with
+ * - parameter factory: Factory that actually creates the object to be associated
+ * - returns: Newly created property
+ */
 public func lazyAssociatedProperty<T: AnyObject>(_ host: AnyObject, _ key: UnsafePointer<Void>, factory: () -> T) -> T {
     var associatedProperty = objc_getAssociatedObject(host, key) as? T
 

    static var lifecycleObject: UInt8 = 1
}

public protocol Disposing: class { }


extension Disposing {
    fileprivate var lifecycleObject: NSObject {

    return associatedProperty!
}

/**
 * Create associated mutable property with given host.
 * Subsequent calls with the same host and key return the same associated objects.
 *
 * - parameter host: Host of the newly created property
 * - parameter key: Key with which the newly created property will be associated with
 * - parameter setter: Setter that will propagate new values to the newly created property
 * - parameter getter: Getter that will read initial value
 * - returns: Newly created MutableProperty
 */
public func lazyMutableProperty<T>(_ host: AnyObject, _ key: UnsafePointer<Void>, _ setter: @escaping (T) -> (), _ getter: () -> T) -> MutableProperty<T> {
    return lazyAssociatedProperty(host, key) {
        let property = MutableProperty<T>(getter())
