bordoley / rx-reason

Reactive programming library for ReasonML/OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Subscriber.decorate to take optional arguments.

bordoley opened this issue · comments

commented

This would avoid a lot of code duplication, ditto for observe operator.

The main issue is for native and the cost of option allocations. It might be able to play tricks with the function definition, such as taking a unit argument to decorate to force evaluation of the optional parameters, and then return an operator function. Users could then hoist this currying up, such that the cost is only paid on module instantiation and not on each individual call to subscribe.

commented

optional arguments didn't work due to the type system. Added helper functions instead.