canjs / can-observe

Observable objects
https://canjs.com/doc/can-observe.html
MIT License
20 stars 2 forks source link

ES Observables [Symbol.observable] function #27

Open BigAB opened 7 years ago

BigAB commented 7 years ago

With proxies and patches in, this might be a time to get more inline with ES Observables to ensure interop with future libraries and patterns that may emerge as these kinds of observables become more commonplace.

I think the best thing we could offer is to implement the [Symbol.observable] function on our can-observe objects and arrays, which could return an event stream that emits a patch event for every change or patch on this object and any child/descendant observables objects/arrays.

This could really give us a foothold into the Reactive space as FRP gain more ground in the JS community, especially when ES Observables become a standard.

Brad had some ideas for implementation: