fp-ts-routing icon indicating copy to clipboard operation
fp-ts-routing copied to clipboard

Prevent `then` from being called after `end`

Open jleider opened this issue 3 years ago • 0 comments

Calling then after end with additional routing parameters the router leads to some unexpected runtime behavior. This change prevents the possibility of then being chained after an end.

The main difference here is the addition of a MatchEnd<A> type which does not contain an imap or then function. If anyone has a better idea of what to name this type or another approach I am happy to entertain alternative ideas.

One thing to note, this is a breaking change so I have bumped the version to 0.6.0 which I believe due to semantic versioning is acceptable due to this package being below 1.0.0.

jleider avatar Jun 08 '22 18:06 jleider