|
|
|
|
|
by bl4ckm0r3
991 days ago
|
|
imo the readability of the proposed solution is not the best, especially for more complex things...
it isn't clear to me if he is proposing that to be "under the hood" (like react's createElement), but if not i don't think it's a better solution (even though i understand the problem of using "custom syntax" but it's pretty normal when you are building "on top" of APIs. |
|
The core idea is that instead of trying to pretend some cool ideas like HOC or render props, we call a dog a dog and say "decorator pattern" and just use the pattern directly [3] and when we need to compose things we do so as well [4]
ref:
- [0] the skeleton I started to settle on a nice API before starting the full rewrite https://mickael-kerjean.github.io/skeleton/example/index.htm...
- [1] original oss project which I'm migrating: https://github.com/mickael-kerjean/filestash
- [2] current state of the rewrite where you can see this pattern in action https://github.com/mickael-kerjean/filestash-rewrite/tree/ma...
- [3] https://github.com/mickael-kerjean/filestash-rewrite/blob/ma...
- [4] https://github.com/mickael-kerjean/filestash-rewrite/blob/ma...