generalize enumerables and event sources
sam-goodwin opened this issue · comments
There's a lot of redundancy in the enumerable implementations: https://github.com/sam-goodwin/punchcard/tree/master/packages/punchcard/lib/enumerable
Can we extract out the common bits into something like a Functor
?
Also, the run
method is statically mapped to the event type, e.g. SQSEvent
, maybe we can model event sources generically, e.g. Queue
implements Source<SQSEvent>
which exposes subscribe(sink: Sink<SQSEvent>)
?
Another pass: 1f39fe9
I wonder how difficult it would be to integrate with these guy's Functor: https://github.com/gcanti/fp-ts