Update from obsidian - thinkpad

Affected files:
.obsidian/workspace.json
games/castlevania-symphony-of-the-night.md
notes/utils/React.md
projects/games.md
This commit is contained in:
Alexander Navarro 2023-09-04 23:17:19 -03:00
parent 28a41d36ce
commit 3a87d09933
4 changed files with 119 additions and 29 deletions

View file

@ -18,8 +18,21 @@
},
"pinned": true
}
},
{
"id": "90eeecc802a23d24",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "games/castlevania-symphony-of-the-night.md",
"mode": "source",
"source": false
}
}
}
],
"currentTab": 1,
"stacked": true
}
],
@ -86,7 +99,7 @@
"state": {
"type": "backlink",
"state": {
"file": "projects/games.md",
"file": "games/castlevania-symphony-of-the-night.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -103,7 +116,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "projects/games.md",
"file": "games/castlevania-symphony-of-the-night.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -126,7 +139,7 @@
"state": {
"type": "outline",
"state": {
"file": "projects/games.md"
"file": "games/castlevania-symphony-of-the-night.md"
}
}
},
@ -159,8 +172,12 @@
"dbfolder:Create a new database table": false
}
},
"active": "fefb57826a3809d6",
"active": "90eeecc802a23d24",
"lastOpenFiles": [
"notes/utils/React.md",
"projects/games.md",
"games/a-hat-in-time.md",
"games/monster-hunter-4-ultimate.md",
"games/zero-escape-zero-time-dilemma.md",
"games/zero-escape-virtue-s-last-reward.md",
"games/zero-escape-nine-hours-nine-persons-nine-doors.md",
@ -183,10 +200,6 @@
"games/omori.md",
"games/mirrors-edge-catalyst.md",
"games/mirror-s-edge.md",
"games/kaze-and-the-wild-masks.md",
"games/it-takes-two.md",
"games/into-the-breach.md",
"games/indivisible.md",
"games/castlevania-symphony-of-the-night",
"igdb",
"projects/radio-notes",

View file

@ -50,3 +50,9 @@ So how or why did it move?? I waited some time and... it moved it on it's own...
I pause the game and yea, it's my playtime, I have been playing for 1 hours and 25 minutes, and that clock interacts with it.
I think that's brilliant, I big landmark (even more since there is the first time you encounter with maria), someplace you really remember, and a pourpose to get back to it eventually. I'm waiting to pass the 2 hours to go back and see what's happend when the hours and minutes are even, maybe nothing, but it's a little adventure to look forward to, and that is what make a metroidvania so good
---
La ubicación de las mejoras es extraña, es como "random" y en lugares super poco significativos, en un pasiillo nada más o algo por el estilo. Además he recorrido un buen trazo del castillo y solo he podido usar el doble salto, el lobo no lo he podido usar
Esto tiene algo positivo y negativo, he tenido poquitos momentos de "Ajá!, ahora puedo ir a este lugar que recuerdo", pero he tenido muchos momentos de "no encuentro nada por aqui, revisaré en otro lado" y me topo con un camino que no me había dado cuenta, reigniting my adventuring spirit

View file

@ -1,3 +1,58 @@
## Typescript
- [Cheatsheet](https://react-typescript-cheatsheet.netlify.app)
## Prevent UseEffect Infinite Loops
React use [shallow comparision](https://learntechsystems.com/what-is-shallow-comparison-in-js/) (values are equals in case of primitive types. In case of object it just check the reference) to check if the dependency changes between renders, this can conduce to bugs in the following situa
### Always use a depency array
```js
useEffect(() => {
setCount((count) => count + 1);
}, []);
```
### Function as dependency
React re defines functions on every render, so the dependency always changes, use `useCallback` to memoize the function so it doesn't change
```js
const logResult = useCallback(() => {
return 2 + 2;
}, []);
useEffect(()=> {
setCount((count) => count + 1);
}, [logResult]);
```
### Array as dependency
The reference to an array changes in every render, use `useRef` so it doesn't change
```js
const [count, setCount] = useState(0);
//extract the 'current' property and assign it a value
const { current: myArray } = useRef(["one", "two", "three"]);
useEffect(() => {
setCount((count) => count + 1);
}, [myArray]);
```
### Object as dependency
The reference to an object changes in every render, use `useMemo` so it doesn't change
```js
const person = useMemo(
() => ({ name: "Rue", age: 17 }),
[] //no dependencies so the value doesn't change
);
useEffect(() => {
setCount((count) => count + 1);
}, [person]);
```
[source](https://blog.logrocket.com/solve-react-useeffect-hook-infinite-loop-patterns/)

View file

@ -183,7 +183,7 @@ columns:
persist_changes: false
footer_formula:
franchises:
input: tags
input: select
accessorKey: franchises
key: franchises
id: franchises
@ -194,24 +194,40 @@ columns:
sortIndex: -1
width: 230
options:
- { label: "None", value: "None", color: "hsl(268, 95%, 90%)"}
- { label: "Bloodstained", value: "Bloodstained", color: "hsl(213, 95%, 90%)"}
- { label: "Doom", value: "Doom", color: "hsl(164, 95%, 90%)"}
- { label: "Mega Man", value: "Mega Man", color: "hsl(302, 95%, 90%)"}
- { label: "Metroid", value: "Metroid", color: "hsl(357, 95%, 90%)"}
- { label: "Monster Hunter", value: "Monster Hunter", color: "hsl(14, 95%, 90%)"}
- { label: "Megami Tensei", value: "Megami Tensei", color: "hsl(270, 95%, 90%)"}
- { label: "Shin Megami Tensei", value: "Shin Megami Tensei", color: "hsl(350, 95%, 90%)"}
- { label: "Persona", value: "Persona", color: "hsl(236, 95%, 90%)"}
- { label: "Portal", value: "Portal", color: "hsl(157, 95%, 90%)"}
- { label: "Resident Evil", value: "Resident Evil", color: "hsl(234, 95%, 90%)"}
- { label: "Sonic The Hedgehog", value: "Sonic The Hedgehog", color: "hsl(297, 95%, 90%)"}
- { label: "Star Wars", value: "Star Wars", color: "hsl(123, 95%, 90%)"}
- { label: "Steins;Gate", value: "Steins;Gate", color: "hsl(140, 95%, 90%)"}
- { label: "Mario Bros.", value: "Mario Bros.", color: "hsl(275, 95%, 90%)"}
- { label: "Mario", value: "Mario", color: "hsl(278, 95%, 90%)"}
- { label: "Valkyria", value: "Valkyria", color: "hsl(35, 95%, 90%)"}
- { label: "Zero Escape", value: "Zero Escape", color: "hsl(130, 95%, 90%)"}
- { label: "[,Megami Tensei,Persona]", value: "[,Megami Tensei,Persona]", color: "hsl(276, 95%, 90%)"}
- { label: "[,Mega Man]", value: "[,Mega Man]", color: "hsl(257, 95%, 90%)"}
- { label: "Monster Hunter", value: "Monster Hunter", color: "hsl(164, 95%, 90%)"}
- { label: "[,None]", value: "[,None]", color: "hsl(157, 95%, 90%)"}
- { label: "[,Shin Megami Tensei,Megami Tensei]", value: "[,Shin Megami Tensei,Megami Tensei]", color: "hsl(127, 95%, 90%)"}
- { label: "[,Megami Tensei]", value: "[,Megami Tensei]", color: "hsl(358, 95%, 90%)"}
- { label: "[,Persona,Megami Tensei]", value: "[,Persona,Megami Tensei]", color: "hsl(104, 95%, 90%)"}
- { label: "[,Shin Megami Tensei]", value: "[,Shin Megami Tensei]", color: "hsl(255, 95%, 90%)"}
- { label: "[,Mario Bros.,Mario]", value: "[,Mario Bros.,Mario]", color: "hsl(66, 95%, 90%)"}
- { label: "[,Metroid]", value: "[,Metroid]", color: "hsl(357, 95%, 90%)"}
- { label: "[,Bloodstained]", value: "[,Bloodstained]", color: "hsl(258, 95%, 90%)"}
- { label: "[,Doom]", value: "[,Doom]", color: "hsl(79, 95%, 90%)"}
- { label: "[,Portal]", value: "[,Portal]", color: "hsl(249, 95%, 90%)"}
- { label: "[,Resident Evil]", value: "[,Resident Evil]", color: "hsl(254, 95%, 90%)"}
- { label: "[,Sonic The Hedgehog]", value: "[,Sonic The Hedgehog]", color: "hsl(76, 95%, 90%)"}
- { label: "[,Star Wars]", value: "[,Star Wars]", color: "hsl(156, 95%, 90%)"}
- { label: "[,Steins;Gate]", value: "[,Steins;Gate]", color: "hsl(282, 95%, 90%)"}
- { label: "[,Valkyria]", value: "[,Valkyria]", color: "hsl(170, 95%, 90%)"}
- { label: "[,Zero Escape]", value: "[,Zero Escape]", color: "hsl(332, 95%, 90%)"}
- { label: "[,,None]", value: "[,,None]", color: "hsl(174, 95%, 90%)"}
- { label: "[,,Monster Hunter]", value: "[,,Monster Hunter]", color: "hsl(124, 95%, 90%)"}
- { label: "[,,Megami Tensei]", value: "[,,Megami Tensei]", color: "hsl(67, 95%, 90%)"}
- { label: "[,,Shin Megami Tensei,Megami Tensei]", value: "[,,Shin Megami Tensei,Megami Tensei]", color: "hsl(352, 95%, 90%)"}
- { label: "[,,Megami Tensei,Persona]", value: "[,,Megami Tensei,Persona]", color: "hsl(135, 95%, 90%)"}
- { label: "[,,Persona,Megami Tensei]", value: "[,,Persona,Megami Tensei]", color: "hsl(315, 95%, 90%)"}
- { label: "[,,Portal]", value: "[,,Portal]", color: "hsl(211, 95%, 90%)"}
- { label: "[,,Resident Evil]", value: "[,,Resident Evil]", color: "hsl(34, 95%, 90%)"}
- { label: "[,,Shin Megami Tensei]", value: "[,,Shin Megami Tensei]", color: "hsl(105, 95%, 90%)"}
- { label: "[,,Sonic The Hedgehog]", value: "[,,Sonic The Hedgehog]", color: "hsl(20, 95%, 90%)"}
- { label: "[,,Star Wars]", value: "[,,Star Wars]", color: "hsl(52, 95%, 90%)"}
- { label: "[,,Steins;Gate]", value: "[,,Steins;Gate]", color: "hsl(264, 95%, 90%)"}
- { label: "[,,Mario Bros.,Mario]", value: "[,,Mario Bros.,Mario]", color: "hsl(103, 95%, 90%)"}
- { label: "[,,Metroid]", value: "[,,Metroid]", color: "hsl(324, 95%, 90%)"}
- { label: "[,Monster Hunter]", value: "[,Monster Hunter]", color: "hsl(137, 95%, 90%)"}
config:
enable_media_view: true
link_alias_enabled: true