samchon / tgrid

TypeScript RPC (Remote Procedure Call) for WebSocket and Worker protocols
https://tgrid.com/
MIT License
141 stars 19 forks source link

Refactor connector classes to assign header in the constructor level. #42

Closed samchon closed 4 years ago

samchon commented 4 years ago

It would better to refactor connector classes to assign header in the constructor level like below. To implement this refactoring without duplicated codes, it would better to refactor all of the connector class to be derived from an abstract class - #41. Also, the header are essential at now, but it would better to reform the header can be null.

export class WebConnector<
        Header extends object | null, 
        Provider extends object | null>
{
    public constructor(header: Header, provider: Provider);
}