One of the most comprehensive books that I have read so far on ESP8266 is one from Neil Kolban. He started a book on the ESP8266 in January 2016; this evolved into a book that considered the ESP8266 and ESP32 together but when he realised that the two chips differed too much for a single book, split the book into two, one for each model. Rather than leave a link here that may well go stale, please search the Internet for the version you need. The early versions, which are still around, are incomplete and in note form; the later versions are more complete but still have gaps where information has not been made available by Espressif.