Skip to content

Create a utility to simplify aggregating reactive links #1136

Open
@gregturn

Description

@gregturn

This pattern kind of gets old:

return Mono.zip(selfLink, aggregateLink, addLink, deleteLink) //
		.map(links -> Links.of(links.getT1(), links.getT2(), links.getT3(), links.getT4()))
		.flatMap(links -> this.repository.findById(id) //
				.map(item -> new EntityModel<>(item, links)));

The first two lines are Reactor boilerplate to take several WebMvcLinkBuild.linkTo....toMono() calls and chain them together into a Mono<Links> object.

If we had a utility method(s), then this could be vastly simplified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions