jgomo3 on Nostr: As the picture shows, the `update-state` function receives an `state`. In the ...
As the picture shows, the `update-state` function receives an `state`. In the function's signature, you destructure `state` extracting `channel` from it. I wonder why you didn't extract also `turtle` in that moment?. You prefered to get the `turtle` explicitly in the `let` expression instead.
I think it was a matter of taste, or style. Maybe related to the fact that `turtle` inside the `let` body is a derivates value from the original `turtle` you get from `state`.
Published at
2023-10-10 02:57:30Event JSON
{
"id": "46d2f8aa99ab90a441a580cf43c61c4624dba93cab88fec2ec08a249f3f40988",
"pubkey": "552b4d02f9db02f11bda4b4c1cdefe8852c6c6b6ca0e03b7013f182c854413b7",
"created_at": 1696906650,
"kind": 1,
"tags": [
[
"e",
"a4c220a6bf2dbd9b617cb6192fc29dbf8c09634c9d01401dbf6d4314f45d3211",
"",
"root"
],
[
"e",
"000745c3de28793c54b80b0dd7f2dc96c0434872c9c8f5dd4fbabc547c68898a",
"",
"reply"
],
[
"p",
"552b4d02f9db02f11bda4b4c1cdefe8852c6c6b6ca0e03b7013f182c854413b7"
],
[
"p",
"2ef93f01cd2493e04235a6b87b10d3c4a74e2a7eb7c3caf168268f6af73314b5"
]
],
"content": "As the picture shows, the `update-state` function receives an `state`. In the function's signature, you destructure `state` extracting `channel` from it. I wonder why you didn't extract also `turtle` in that moment?. You prefered to get the `turtle` explicitly in the `let` expression instead.\n\nI think it was a matter of taste, or style. Maybe related to the fact that `turtle` inside the `let` body is a derivates value from the original `turtle` you get from `state`.",
"sig": "0dac6b7dcd620638cf3dee774965afcb27d63b88b676132292440b03087a2972baa994fe273f3cdf8c08ee234e2c6fc63cbb233a3b3064a20ce5281774b6e541"
}