It is probably better to create a dedicated function to create the link so you can avoid creating two anonymous functions. Thus:
Although in both cases you end up with two functions, I just think it is better to wrap it in a function that is semantically easier to comprehend.