just when; no sooner than
Describes an action that happens immediately after another, often with surprise at the quick succession.
Use this when one thing happens and then, almost at once, the next thing occurs, often so quickly that it's surprising. It emphasizes the brevity of the interval. For example, you might say this when someone starts and stops doing something in rapid succession, or when a situation changes in an instant.
The second clause often describes an unexpected or opposite action. It's used in both spoken and written Japanese, but tends to appear in narratives or when describing observed events. It can also be used with adjectives and nouns to express that a state has just been established when another state appears.