“Watch your back,” one friend texted.

“Be safe out there,” another wrote.

At home, Mrs. Janu was trying to erase the image of a dying black man from her mind. She had delighted that day in one of Wesley’s milestones, when she realized he was following her every move with his eyes, and recorded the thrill in an app tracking his development.

But then, as she was nursing her baby, she signed onto Facebook and there was Philando Castile, slumped and bleeding in his car in Minnesota, while his girlfriend filmed her confrontation with the officer who had shot him.

Mrs. Janu scrambled to press the pause button, but she had already seen too much. She sat stunned on the sofa, with Wesley in her arms, reliving her fears about his future.

She was asleep by the time Mr. Janu came home. By then, he knew why he had received the urgent texts. Five Dallas police officers had been shot to death that night. Shaken, he stayed up all night, flipping between CNN, MSNBC and Fox until dawn. Only then did he talk to his wife about what had happened in Texas.

“All I wanted to do was hug her,” he said.

The couple met six years ago, casually introduced by mutual friends who were shocked when they got together. Mrs. Janu, who is wry and bracingly frank, had vowed never to date a police officer. She had grown up hearing her parents’ stories about ugly encounters between African-Americans and the police in the segregated South.

She remembers the day her father was pulled over. She was 7 at the time, sitting in the back seat. And she still remembers the pains he took afterward — checking and rechecking his turn lights and headlights — to ensure that it would never happen again. “Bullies,” she said, matter-of-factly describing the men she assumed joined the force.