Similar to my recent question about moving between a spell's attacks I am curious about whether RAW you can use a bonus action between a spells attacks.
Unlike in the case of movement, bonus actions do not have a section specifying that they can occur in between parts of a particular type of action. The rules section on bonus actions reads (PHB, 189):
You choose when to take a bonus action during your turn, unless the bonus action’s timing is specified, [...]
The answer to this question is very relevant to Warlocks who might use Eldritch Blast against the target of their Hex but slay the target before every blast of Eldritch Blast has been used. The Warlock would then want to target a new creature with the remaining blasts (see this answer on changing targets during a spell) but first use their Bonus Action to move Hex to the new target.
If the particular bonus action is relevant to your answer, you can use the moving of Hex to a new target as the use-case - but I would also appreciate a general understanding of when, if ever, bonus actions can split up a spell's attack.
Related: Can you use a bonus action from Cunning Action in the middle of an Attack action?