import { inject } from '@angular/core';
import { ResolveFn } from '@angular/router';
import { take } from 'rxjs/operators';

import { Jump } from '@models';
import { JumpsService } from '@services';

export const lastjumpResolver: ResolveFn<Jump> = () => {
    return inject(JumpsService).getLastJump().pipe(take(1));
};