Bluetooth-serial readUntil('\n') when device sender send data

Hi everyone.
I have very simple question.
I’m using bluetooth-serial for connect and receive from arduino and i use readUntil(’\n’) for receive from arduino
I use readUntil with setInterval and inside constructor but I think this way wrong because it’s has very lag .
I need help for this situation.

constructor(private bluetoothSerial: BluetoothSerial, public navCtrl: NavController, public navParams: NavParams) {
    setInterval(() => {
      this.bluetoothSerial.readUntil('\n').then((data: any) => {
        if (data.indexOf("code:") != -1) {
          var si = data.indexOf("code:");
          this.code = data.substring((si + 5), data.length);
        }
      });
    }, 0);
  }

I need read from arduino and find some information from sender device and i use substring for looking for some data and my situation very lag…
Thanks for help

Finally I find solution for this problem but if exist another solution for this problem please send for me.
I use ionViewDidLoad and use this.bluetoothSerial.subscribe(’\n’).subscribe

  ionViewDidLoad(){
    this.bluetoothSerial.subscribe('\n').subscribe(
      data=>{
        this.repeat = data;
        this.bluetoothSerial.clear();
        setTimeout(() => {
          this.change.detectChanges();
        }, 100);
    });

Hi.
Could you put the complete code of how to read and send to arduino?
I’m stuck and can’t move forward.
Thank you very much.

This is for sending to arduino. I will give code for receiving as well. or you may go through github link in the article