Mumbai, India
Joined February 2017
I don't understand why people recreate everything for Effect... Like the whole point of Effect being embedded into TypeScript is that you can just use TypeScript libraries... If there are effects that the library makes then sure wrap them into an Effect type... 🤷🏻‍♂️
Been building an @EffectTS_ native ORM for a while, and it's finally ready for some of you to try. - includes ClickHouse + Postgres - Fully typesafe - Migrations for both, and it can adopt your existing drizzle-kit migrations Still early, but it's been running @Mapledotdev in production for about a month. github.com/MapleTechLabs/eff…
1
2
676
.@DavidKPiano thoughts on using the pattern that sthir uses for types in future xstate versions? Would love if my types reach everyone! The only barrier is the `_: undefined` thing but I hope @AndaristRake gets to fix it soon as he said in TypeScript#64251
📢📢📢 @​sthir/machine (and @​sthir/machine/effect) now work with non-forked typescript as well!!! The difference? 1. You just have to explicitly type things more (but still less than other libraries) 2. You have to write stupid `_: undefined` at times (see typescript#64251)
1
2
504
Here are some of the features to recap: - xitter.cf/devanshj__/status/2094… (minus 4 & 5, these were the advanced features) - xitter.cf/devanshj__/status/2097… (just have to explicitly type error and requirement once now instead of inference)
🚨 @​sthir/machine/effect is here!!! 🚨 cc @EffectTS_
1
119
So I did this anyway :P xitter.cf/devanshj__/status/2098…
Fun fact: I can probably support all the features that @​typeonce/effect-machine supports (and more), *with xstate api* and *without changing the compiler* But that means I'll have to drop all the super cool @​sthir/machine/effect features, eg this entry event narrowing...
69
3. Don't get the crazy advanced features (that other libraries never had in the first place) Everything else remains the same... Zero compromise on type-safety!
1
142
📢📢📢 @​sthir/machine (and @​sthir/machine/effect) now work with non-forked typescript as well!!! The difference? 1. You just have to explicitly type things more (but still less than other libraries) 2. You have to write stupid `_: undefined` at times (see typescript#64251)
1
1
3
847
>be me >try to fix xstate >end up breaking it github.com/microsoft/TypeScr…
4
405
Oh I code golfing with RxJS... 🏌🏻‍♂️⛳️ 1/3rd the size! (and 3 times the sophistication :P) stackblitz.com/edit/vitejs-v…
Full "copy button" example with effect-machine 📦 Nested states 🪄 @EffectTS_ Clipboard module ⛔️ Error handling state ⏱️ Timer A simple but rather complete example 👇
173
Here's a real typescript problem that I've encountered that even I'm having a tough time trying to solve... I wonder if anyone can crack it... tsplay.dev/Nnz0BN
2
230
Holy cow I solved it! Admittedly cheated a bit by changing the `Brand` definition but that was permissible as long as it has the same variance and no loss of information tsplay.dev/WkyQlN
103
Elm architecture is cool until you try to do something as simple as debouncing... Constraining things to first order FRP is very limiting... It shouldn't take more than a line to create a debounced event...
1
268
But it can be easily fixed... You just need to support something that takes a stream of events and gives a stream of events... Elm had a undocumented feature called "effect managers" that could do this... But they killed it simonh1000.github.io/2017/05…
1
1
302
Anyway React just takes FRP to the next level by making it "transparent" // rxjs, etc type Behavior<T> = (s: (v: T) => void) => () => void // solid, mobx, etc type Behavior<T> = () => T // react type Behavior<T> = T iykyk
279
Maybe I should go back to this graceful degradation idea... But my problem is it doesn't move the needle... It's so boring to have your users type every state-context pair, offer no conflow flow analysis, no effect error & requirement propagation... meh xitter.cf/devanshj__/status/2096…
I was trying to support non-forked typescript with graceful degradation along with my fork with this feature detection... (`IsSthir` is true in my fork but false in original) But it's just not possible... Can't infer things and there are weird typescript bugs too... 🤷🏻‍♂️
1
1
178
It would still be the best state machine library out there but it still won't be as great as it could be with typescript#64091 🤷🏻‍♂️
1
84
Fun fact: I can probably support all the features that @​typeonce/effect-machine supports (and more), *with xstate api* and *without changing the compiler* But that means I'll have to drop all the super cool @​sthir/machine/effect features, eg this entry event narrowing...
1
1
4
428
In this example it's doesn't really matter because you can get the username from the context instead of the event... (sthir supports both)
1
1
120