The easiest way to say “as soon as A, B” with the grammar already introduced is to simply use the word “immediately” (すぐに) with the conditional.
〜したらすぐに…
When I do 〜 I immediately…
ご飯を食べ終わったらすぐに部屋に戻ってテレビを見る。
As soon as he’s finished eating he goes back to his room and watches television.
However, here we introduce some more grammatically complicated ways of forming this expression.
~途端に
JLPT N3 grammar. ~した途端に means the moment A happened, B also happened. It is more colloquial than が早いか (see below) and has the same meaning as ~した瞬間に (literally “at the moment”…). Grammatically, 途端に requires the past tense.
横になった途端に爆睡した。
The moment I lay down I fell into a deep sleep.
泥棒が警察官を見た途端に逃げ始めた。
The moment the robber saw the police officer he started to run away.
A Critical Rule for 途端に (No Intentional Actions)
There is a very strict rule for using 途端に: The second clause cannot be a deliberate, planned action by the speaker. It must express an unexpected result, a natural occurrence, or an action outside of your direct control.
家に帰った途端に、お酒を飲んだ。(✘)
家に帰ったらすぐにお酒を飲んだ。(✔)
As soon as I got home, I drank alcohol.
Drinking alcohol is an intentional action, making 途端に incorrect. You must use したらすぐに instead.
家に帰った途端に、雨が降り出した。(✔)
As soon as I got home, it started to rain.
The rain is a natural occurrence outside of your control, making 途端に perfectly natural here.
~が早いか~
JLPT N1 grammar. が早いか can be used with both the present and past tense but usage with the present tense (as in the sentence above) is more common. The phrase literally suggests that you don’t know which action took place first because they happened so quickly.
ご飯を食べ終わるが早いか部屋に戻ってテレビを見る。
As soon as he’s finished eating he goes back to his room and watches television.
ベルが鳴るが早いか学生は教科書を鞄に押し込んで教室から飛び出してきた。
As soon as the bell rang the students shoved their textbooks into their bags and flew out of the classroom.
旅行から帰ってくるが早いかインターネットで観光地を調べ始める。
As soon as she gets back from holiday she’s on the internet searching for tourist destinations.
その歌手は大人気だよ。コンサートチケットは販売されるが早いか売り切れとなる。
That singer is very popular. Her concert tickets are sold out the moment they go on sale.
Generally speaking, が早いか is probably used more often in writing, but can occasionally be heard in conversation, as well.
~や否や~
JLPT N1 grammar. ~や否や~ is identical to が早いか but is only used in writing.
横になるや否や爆睡した。
As soon as I lay down I fell asleep.
そばから
JLPT N1 grammar. そばから has a slightly different nuance to the expressions above. This phrase is used to suggest a repeatable pattern: “whenever A happens, B happens”. Note: This grammar point almost always carries a negative nuance of frustration or futility. The speaker is annoyed that the results of the first action keep being immediately undone.
新しい漢字を覚えるそばから忘れてしまうんだよ。どうしたらいいの?
As soon as I learn a new kanji character I forget it. What should I do?
うちの子供は食べるそばからお腹がすいていると泣いちゃうよ。お相撲さんになるだろうね。
As soon as my child has eaten he starts crying that he’s hungry. I reckon he’s going to become a sumo wrestler.
バイトで稼いだお金が銀行口座に振り込まれるそばから使っちゃう。
The moment the money from my part-time job hits my account I spend it.