stream-mixin
stream-mixin is a classic-stream mixin for browser code. It uses the functional mixin pattern to add classic stream functionality to your objects.
Install
$ npm install stream-mixin
…or just grab a pre-built standalone version from the project’s build directory.
Usage
var stream =// Make a stream from an Object…var mailman = {}streammailmanwritable = truemailman {if /!/mailman}// …or a Classvar {}var dog =streamDogprototypereadable = trueDogprototype {this}// Listen to events explicitly…mailman// …or implictlydog// Ok, go!dog
Note
juliangruber’s module is almost identical to this one, but it depends on the component package manager.