As soon as practicable after the commencement of an action brought as a class action, the court shall determine by order whether it is to be so maintained. An order under this section may be conditional, and it may be amended before decision on the merits. An order issued under this section shall be immediately appealable by either party.