|
Henrik Joreteg
@
HenrikJoreteg
Spokane, WA
|
|
PWA developer, consultant, author, and immigrant.
Architected Starbucks' PWA.
Owner: anesthesiacharting.com
My latest book: read.reduxbook.com
|
|
|
21.047
Tweetovi
|
467
Pratim
|
18.307
Osobe koje vas prate
|
| Tweetovi |
|
Henrik Joreteg
@HenrikJoreteg
|
3. velj |
|
Also, I've recently started thinking reducers, at least in some cases, may be better implemented with the help of simple finite state machines.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
3. velj |
|
It's basically too low level for most out of the box.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
3. velj |
|
And... I mean... I've done some quite complex things with it. The big gap is there isn't a built in, efficient way to read specific information from it. In addition, manual state twiddling gets a bit laborious unless you're very diligent (or build helpers).
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
3. velj |
|
It's all in how you use it, I think. I've had a fair bit of experience with it... my summations are all here (it's not just a blog post, though): read.reduxbook.com
|
||
|
|
||
| Henrik Joreteg proslijedio/la je tweet | ||
|
John Arundel
@bitfield
|
20. sij |
|
Junior dev: My code is simple and easy to understand.
Mid-level dev: My code is subtle, clever, innovative, expressive, hyper-optimized, and ingenious.
Senior dev: My code is simple and easy to understand.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
29. sij |
|
I'm just going to leave this here: twitter.com/HenrikJoreteg/…
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
29. sij |
|
The "const" in the first case is not scoped to just that case statement. So the first const is already available in the second case.
Solutions:
1. Add curly statements to case to create a block scope (lint rules exist for this).
2. Don't use switch (aka, the Python solution 😅)
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
29. sij |
|
For the curious, this was in part to provide data for a conversation on a project about switch statements versus multiple "if" statements.
Turns out variable scoping in case statements is not generally well understood.
Only half saw an error.
IMO "switch" is a trap. twitter.com/HenrikJoreteg/…
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
29. sij |
|
Always spaces... always 😁
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
28. sij |
|
I'm trying not to reply yet so that people immediately see the reply and therefore the answer... 😅
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
28. sij |
|
It's quite possible this was addressed in redux-bundler already. I seem to recall making this change, but can look later. The book may well need to be updated.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
28. sij |
|
The following code is...
switch (type) {
case SELECTED:
const current = 'a'
// ... other code then return
case UN_SELECTED:
const current = 'b'
// ... other code then return
}
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
24. sij |
|
I chortled twitter.com/ericnakagawa/s…
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
24. sij |
|
Speaking of Starbucks technology... Can we get long sessions on the PWA yet 😅
The password only thing is ok but kind of annoying.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
22. sij |
|
Hmm... yeah
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
22. sij |
|
I liked the Twitter PWA better without all these promoted tweets 😅
|
||
|
|
||
| Henrik Joreteg proslijedio/la je tweet | ||
|
Sean Grove
@sgrove
|
21. sij |
|
Using node/babel/webpack/ts/react is like playing chess:
Within 13 steps, you're debugging a unique error no one else in the universe has ever encounteed.
|
||
|
|
||
| Henrik Joreteg proslijedio/la je tweet | ||
|
Eric Lawrence 🎻
@ericlaw
|
19. sij |
|
Until around eight years ago I did, which was around the time y'all shoulda stopped using it.
|
||
|
|
||
| Henrik Joreteg proslijedio/la je tweet | ||
|
Eric Lawrence 🎻
@ericlaw
|
19. sij |
|
I don't know who needs to hear this, but... don't use Internet Explorer to browse the web.
|
||
|
|
||
|
Henrik Joreteg
@HenrikJoreteg
|
19. sij |
|
What are you guys using this for, if you don't mind me asking?
|
||
|
|
||