angular-tetris icon indicating copy to clipboard operation
angular-tetris copied to clipboard

State adapt

Open mfp22 opened this issue 2 years ago • 2 comments

Branched off of https://github.com/trungk18/angular-tetris/pull/50

But this should build because it removes Akita. Unless something else is wrong.

I originally didn't plan on creating a PR, so I have some changes in here you may not like. I got rid of _ variable prefixes, for example.

There were a few places I needed to synchronously access state, which I handled with a quick hack using take(1)).subscribe(. For me to get rid of these, I would have to refactor the components too, not just the stores. This could be a fun project, making the whole thing 100% reactive. I could use signals too, where I think it makes sense.

For now I am just updating with these PRs over in my fork, so I thought I'd share in case you wanted anything.

mfp22 avatar Jul 20 '23 23:07 mfp22

Oh and I had to turn on strictNullChecks for StateAdapt type inference to work correctly.

mfp22 avatar Jul 20 '23 23:07 mfp22

Here's a YouTube video I made while refactoring this https://www.youtube.com/watch?v=sUfahKhzZzc

mfp22 avatar Jul 20 '23 23:07 mfp22