Skip to content

Conversation

@orun-sunny
Copy link

Type request as Observable for clarity and type safety

Description

By declaring the variable type, developers can better understand the asynchronous nature of the service methods and get improved IDE support (autocomplete, type inference, etc.).

Checklist

  • I fully tested it as developer
  • I tested the create and update flows to ensure everything works as expected

I verified that the modal closes, the form resets, and the list refreshes after submission

How to test it?

Open the form modal (e.g., "Add Book" or "Edit Book").

Fill in the form and submit.

Ensure the form triggers the proper API call (create or update).

Type request as Observable<any> for clarity and type safety
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sumeyyeKurtulus
Copy link
Contributor

Hello,

Thanks for this PR! The line const request: Observable<any> = ... is actually not needed. The inference of TypeScript already correctly types request as Observable<BookDto>, making the explicit Observable<any> redundant and less specific.

We will close this PR for now. Thanks again for your contribution!

@sumeyyeKurtulus sumeyyeKurtulus removed their request for review May 27, 2025 13:32
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

Successfully merging this pull request may close these issues.

3 participants