Totally agree with you!
I use classes only for "facades" and to structure better the actual code but i do not extend them.
Mostly i am using Reader monadic approach inspired from haskell
export type Reader<T, K> = (d?: T) => K;
The way it is used
class MyClass { myMethod() { return 1; } } const myFunction: Reader<[MyClass], number> = () => ([myClass]) => myClass.myMethod()
const myClass = new MyClass (); myFunction()([myClass])
This pattern suits me well and i have invested some time to create @rhtml/di
Dependency injection written in typescript and working inside Deno also
github.com/r-html/rhtml/tree/maste...
Cheers!
Thanks for your contribution! I really appreciate it
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Totally agree with you!
I use classes only for "facades" and to structure better the actual code but i do not extend them.
Mostly i am using Reader monadic approach inspired from haskell
The way it is used
This pattern suits me well and i have invested some time to create @rhtml/di
Dependency injection written in typescript and working inside Deno also
github.com/r-html/rhtml/tree/maste...
Cheers!
Thanks for your contribution! I really appreciate it