material-motion-js icon indicating copy to clipboard operation
material-motion-js copied to clipboard

Consider using Symbol.species rather than proxies

Open appsforartists opened this issue 8 years ago • 1 comments

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species

This would clean up/DRY out the codebase (proxies is a bit of a hack), and provide a possible extension point for 3rd parties to create new derivations of MotionObservable. _multicast and _remember would use IndefiniteSubjects for multicasting, and return an instance of species subscribed to the subject to ensure callers have operators. The other operators would just use new this[Symbol.species] rather than new MotionObservable.

appsforartists avatar Sep 27 '17 08:09 appsforartists

This is basically #194.

appsforartists avatar Sep 28 '17 05:09 appsforartists