def store_till_end_callback_factory(destination=lambda m: None):
    """
    A :func:`callback_factory` which stores the messages in a list
    and send them to the destination at the last message

    Parameters
    ----------
    destination : callable (Default : destination=lambda m: None)
        A function which takes as input a list of string

    Return
    ------
    :func:`store_till_end_callback`
    """
    messages = []
    def store_till_end_callback(string, last_com=False):
        """
        A :func:`callback` which stores the messages in a list
        and send them to the destination at the last message

        Parameters
        ----------
        string : str
            The string to process
        last_com : bool (Default : False)
            Whether is it the last message or not
        """
        messages.append(string)
        if last_com:
            destination(messages)
    return store_till_end_callback