mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 175 forks source link

a generic question #621

Open jmls opened 6 years ago

jmls commented 6 years ago

in the base service class , the methods are defined with a generic parameter as such : export abstract class BaseLoopBackApi { ...snip... public onUpdateAll(where: any = {}, data: T): Observable<{ count: 'number' }> { ...snip...

does anyone have an idea why ? Wouldn't defining <T> on the class itself have the same effect ?

ie

export abstract class BaseLoopBackApi<T> 

and then remove all the definitions on the methods ...

export abstract class BaseLoopBackApi<T> {
...snip...
public onUpdateAll(where: any = {}, data: T): Observable<{ count: 'number' }> {
...snip...

I may be missing something obvious, so I thought I'd ask