sjohnsonaz / BuildJS-Full

A simple utility for class definition, inheritance, dynamic loading, MVVM, Widgets, and backend MVC.
http://buildjs.com
0 stars 0 forks source link

Optimize Observable subscribe and unsubscribe. #50

Closed sjohnsonaz closed 9 years ago

sjohnsonaz commented 10 years ago

Subscribing to observables currently only works for single subscriptions. A subscriber may want to subscribe to many observables at once. Furthermore, if a subscriber is removed, it still lives in the subscriber list of the observables, which will prevent garbage collection.

We need to streamline this process as much as possible.

sjohnsonaz commented 9 years ago

Added destroy method to Widget. This can then be called either manually, or from conditional or iterative binding handlers.

sjohnsonaz commented 9 years ago

Added multiple subscription to OneWayBinding. Values are cached upon update. Still need to delay evaluation until all values are cached.

sjohnsonaz commented 9 years ago

Subscribing Modules destroy their subscriptions when their respective destroy methods are called.

sjohnsonaz commented 9 years ago

Evaluation of OneWayBinding is delayed until all are subscribed.