Leaflet does not read WFS, so our WFS example will be OpenLayers only. Consuming WFS means reading, retrieving, and rendering vector data on the client side. Such processes may be intensive on PC resources - we will therefore use a rather small dataset with the ne_reefs vector so we do not have to bother with performance issues when dealing with larger vector datasets.
There are different techniques for dealing with large datasets, such as the bounding box strategy, mixing WMS for smaller scales, displaying with WFS for larger scale display, and using vector tiles. Those are not specific to the data source as such, and therefore I will not elaborate on the subject.
Our web example will be very similar to the previous one with WMS only. The different part is the layers declaration:
createLayers: function(){
var proj = ol.proj.get('EPSG:4326');
format = new ol.format.WFS...