*Code Update* When I handled the UpdateComplete action at th-cam.com/video/Az5bNV1Vthc/w-d-xo.html I got fooled by Copilot and accepted the wrong code :( When we are dealing with the state, we should NOT mutate the state. We should produce a new state instead. This is the correct code const updatedTodoItems = state.todos.map((item) => { if (item.id === id) { return { ...item, completed: !item.completed, }; } return item; });
I don't how I can express what I feel right now, you won't understand how much your video helped me after being stuck for more than 24 hours! thanks a lot!
Great video as always, I have never used ngxs before only ngrx. 2 quick questions: In your experience what would make you choose one over the other? ngrx / ngxs What vs code plug-in shows the function parameters names, as I would find it very useful? I hope this makes sense😂 I.e createSelector(selectors: ..., projector: ...)...
For the VSCode, you can set these properties in your JSON file // This displays the parameter names "typescript.inlayHints.parameterNames.enabled": "all", // This displays the variable types "typescript.inlayHints.variableTypes.enabled": true,
As of the NGRX/NGXS, I find the NGXS easier to use and has less boilerplate code. I have tried NGXS from small to enterprise applications and it fits great on every occasion :)
*Code Update*
When I handled the UpdateComplete action at th-cam.com/video/Az5bNV1Vthc/w-d-xo.html I got fooled by Copilot and accepted the wrong code :(
When we are dealing with the state, we should NOT mutate the state. We should produce a new state instead.
This is the correct code
const updatedTodoItems = state.todos.map((item) => {
if (item.id === id) {
return {
...item,
completed: !item.completed,
};
}
return item;
});
I don't how I can express what I feel right now, you won't understand how much your video helped me after being stuck for more than 24 hours! thanks a lot!
Great Tutorial! Perhaps you can create a Tutorial how to solve Daily problems with redux devtools / add logging / find bugs etc?
Great video as always, I have never used ngxs before only ngrx.
2 quick questions:
In your experience what would make you choose one over the other? ngrx / ngxs
What vs code plug-in shows the function parameters names, as I would find it very useful? I hope this makes sense😂
I.e createSelector(selectors: ..., projector: ...)...
Inline Parameters for VSCode
For the VSCode, you can set these properties in your JSON file
// This displays the parameter names
"typescript.inlayHints.parameterNames.enabled": "all",
// This displays the variable types
"typescript.inlayHints.variableTypes.enabled": true,
As of the NGRX/NGXS, I find the NGXS easier to use and has less boilerplate code.
I have tried NGXS from small to enterprise applications and it fits great on every occasion :)