3 ms·
Changing values (after a change in an external interface), tracking use and renaming is harder in the first case. In the second case, the code can change the va
by tgv 2y ago
Changing values (after a change in an external interface), tracking use and renaming is harder in the first case. In the second case, the code can change the value at runtime.
- mistercow 2y ago> Changing values (after a change in an external interface), tracking use and renaming is harder in the first case. You can rename the elements of a string union with the typescript language server. In VS Code at least, it's just like renaming a variable, and it updates the usages which use the type. > In the second case, the code can change the value at runtime. You can always freeze the object if you're worried about that.
- skrebbel 2y ago> Changing values (after a change in an external interface), tracking use and renaming is harder in the first case. FWIW in VS Code I can rename a string literal (in the type definition) and it's renamed everywhere. Similarly I can use "Find All References", it just works. Pretty cool!