Skip to content

Long story short, I am tried of tutorials, and I am still trying. and the most efficient way I found out is the trials and error. so this a journal to record my journey, a 30 day challenge to learn and explore the world of web design and development

Notifications You must be signed in to change notification settings

TenzDelek/ExperimentLab

Repository files navigation

parallel fetching

usually there are fetching (async await) it does that in a waterfall manner means like a step(stair). one is finish then other is started (good when next is depend on prev) but if the both function are independent we can do that in parallel saving the runtime. so we use Promise.all

const[data1,data2]=Promise.all([getdata1(),getdata2()]) here if one get wrong all are mark wrong

const[data1,data2]=Promise.allSettled([getdata1(),getdata2()]) but settled makes only the one wrong, wrong.

server action can also be done in client

demo serveraction

normal server action in server component

server demo

button has type="submit"

serveractionform

also remember to validate and auth

alt text

adding a timeout

alt text

fallback need to be above await

if changes happens in suspense

alt text put key so that if the key changes the fallback will happen(trigger)

redirect cant be use in trycatch

alt text error

the correct way is alt text

About

Long story short, I am tried of tutorials, and I am still trying. and the most efficient way I found out is the trials and error. so this a journal to record my journey, a 30 day challenge to learn and explore the world of web design and development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published