Prefer passing configuration through constructor parameters rather than setting properties after instantiation. This makes APIs more predictable, enables immutability, and clearly communicates required dependencies at creation time. Additionally, use consistent method naming conventions like `.invoke()` for primary API methods.
Prefer passing configuration through constructor parameters rather than setting properties after instantiation. This makes APIs more predictable, enables immutability, and clearly communicates required dependencies at creation time. Additionally, use consistent method naming conventions like .invoke()
for primary API methods.
Instead of this:
const loader = new GoogleDriveLoader();
loader.recursive = true;
loader.folderId = "YourGoogleDriveFolderId";
Do this:
const loader = new GoogleDriveLoader({
recursive: true,
folderId: "YourGoogleDriveFolderId"
});
Similarly, when adding methods to an API class, prefer descriptive action names like invoke()
over generic terms like call()
. This creates a more intuitive API that follows established patterns across the ecosystem.
Enter the URL of a public GitHub repository