import {
  makeCharacteristicEventListener,
  ReactNativeBluetooth,
} from './lib';

const writeCharacteristicValue = (characteristic, buffer, withResponse) => {
  return new Promise((resolve, reject) => {
    if (!withResponse) {
      ReactNativeBluetooth.writeCharacteristicValue(characteristic, buffer.toString('base64'), withResponse);
      resolve();
      return;
    }

    const resultMapper = detail => detail;

    makeCharacteristicEventListener(resolve, reject, ReactNativeBluetooth.CharacteristicWrite, characteristic, resultMapper);

    ReactNativeBluetooth.writeCharacteristicValue(characteristic, buffer.toString('base64'), withResponse);
  });
};

export {
  writeCharacteristicValue,
};

@@ -508,17 +508,19 @@
 sticWrit
-e
+ten
 , charac

Fix error introduced in refactoring of characteristic write.