289. Fixing a Bug with the Resolver
Jul 22, 2026 02:13
· 1:43
· English
· Whisper Turbo
· 2 Oradores
Esta transcrição expira em 9 dias.
Atualização para armazenamento permanente →
A mostrar apenas
0:01
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
If I do fetch my recipes and I try to edit one of them,
0:05
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
for example,
0:06
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
I want to add an exclamation mark here,
0:07
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
you see that these changes are not saved.
0:11
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
And the reason for that is the resolver,
0:12
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
which is used whenever we visit the recipe detail route.
0:16
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
It fetches new recipes from the server and that simply overwrites
0:20
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
our existing recipes,
0:22
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
including our changes to these recipes.
0:24
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
Now the solution is,
0:27
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
to first check whether we do have recipes and only fetch new ones
0:31
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
if we don't.
0:32
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
So I can inject my recipes
0:36
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
service here,
0:38
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
like this,
0:41
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
import it from recipe service.
0:43
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
With this injected,
0:45
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
we can get our recipes from this recipe service,
0:49
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
get recipes.
0:52
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
And now we can check if recipes length is equal to zero,
0:56
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
then this means we have no recipes and we should fetch them.
1:00
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
Otherwise, if this is not zero,
1:02
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
we can just return these recipes because then,
1:05
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
well, we do have recipes,
1:06
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
so no need to fetch them again.
1:08
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
With that change,
1:10
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
we can still reload the page whilst we're on it,
1:13
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
but we can also,
1:15
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
of course, reload the app somewhere else and just fetch data.
1:17
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
But now,
1:18
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
if I edit this,
1:20
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
indeed,
1:21
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
the changes are saved.
1:23
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
If I reload,
1:24
S…
Speaker 1 (289. Fixing a Bug with the Resolver)
then I then...
1:26
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
Get my old data because I didn't save them to the server before my
1:30
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
changes But they were saved locally and if I would have chosen save data,
1:34
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
we would have also saved up on a server So this is a tiny adjustment which we
1:38
S…
Speaker 2 (289. Fixing a Bug with the Resolver)
should make to avoid strange bugs
Essa transcrição foi gerada pela IA (reconhecimento automático de fala). Pode conter erros — verificar contra o áudio original para uso crítico. Política de IA
Resumo
Clique em Summarize para gerar um resumo de IA desta transcrição.
Resumindo...
Pergunte à IA sobre este Transcrito
Pergunte qualquer coisa sobre esta transcrição — a IA vai encontrar seções relevantes e resposta.