//
// PropertyObserver.swift
// DocHub
//
// Created by Tristan Juricek on 6/24/14.
// Copyright (c) 2014 Perforce. All rights reserved.
//
// Can be used to monitor changes of a particular property, by a simple array
// of callbacks.
class PropertyObserver<T> {
// The callback methods that will be called when the fire() method is used
var listeners:Array<T -> ()> = []
func fire(propertyValue:T) {
for listener in self.listeners {
listener(propertyValue)
}
}
}