Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outfactor shared logic in input components #93

Open
XanderVertegaal opened this issue Jan 9, 2025 · 1 comment
Open

Outfactor shared logic in input components #93

XanderVertegaal opened this issue Jan 9, 2025 · 1 comment

Comments

@XanderVertegaal
Copy link
Contributor

XanderVertegaal commented Jan 9, 2025

Okay, considering the exportResult function from spindle.component.ts:

public parse(): void {
        this.form.controls.mpInput.markAsTouched();
        this.form.controls.mpInput.updateValueAndValidity();
        const input = this.form.controls.mpInput.value;
        if (this.form.invalid || !input) {
            return;
        }
        this.apiService.input$.next(input);
    }

These functions are very similar: could we think of a good way to make them generalizable / put them in a service? Is that even worthwhile, do you think? I'm happy to let this rest since it's not really priority but I was wondering all the same.

Originally posted by @Meesch in #84 (comment)

@XanderVertegaal
Copy link
Contributor Author

I'd consider the SpindleAPIService and MpAPIService for this. Both implement ParsePortDataService; maybe we can add more shared logic to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant