This is my first contribution to arduino open source library. This wifimanager is an event driven. This library will also help on handling different events that may occur within your wifi station or access point such as disconnection, reconnection and etc.
If you want to use the library, please see link below.