just as; right after; as soon as; at that moment
Used after a verb in the past tense or a noun to indicate that something happens immediately after the preceding action or state. Often implies an unexpected or sudden result.
The moment I opened the door, a cat jumped out.
Just as I left the house, it started raining.
彼はその話を聞いた途端に笑い出した。
He burst out laughing the moment he heard that story.
I stood up. At that very moment, the lights went out.
すぐに just means 'immediately' in general contexts, while 途端に specifically links two events so that the second happens right after the first, often unexpectedly.
突然 describes something happening abruptly with no set-up, while 途端に always follows a specific preceding action or event that triggers the result.
From 途端 (とたん, 'the moment when something happens') + particle に. The noun 途端 itself is composed of 途 (way, path) and 端 (edge, end), literally 'the edge of the path', metaphorically the exact moment.