How can it return an effect function if the return type is void?