* ```
*
* @param matchers an object of functions that will be invoked
* for each view type
*/
export function match(matchers: {
Edit: () => Z
View: () => Z
}): (displayType: DisplayType) => Z {
return d => (d === DisplayType.Edit ? matchers.Edit() : matchers.View())
}