Closed avgerin0s closed 11 years ago
Just thought it'd be nice to have these. :)
It's a bigger thought, but I'd question whether events should be stored as arrays internally. If you're creating a lot of streams you don't really want them all to be stored longer than they're needed or you're just going to be accumulating memory like crazy. The nice thing about bacon is that streams are lightweight - creating a stream has ~0 overhead unless it has subscribers, and even then it shouldn't be significant.
Yes, they should not be arrays, it's just a temporary thing.
Thanks @eavgerinos , but I think that this isn't needed for now, since that will change anyway.
events Returns an array with all the events happened to current stream (@ values)
has_event?(event) Returns true if the given event has happened in the current stream, else false.