OpenLayers 3 - Get applied style for rendered feature
<p>Is it possible to get the applied style for a selected feature? My layer uses a style function instead of an ol.style.Style. When I call myFeature.getStyle() it returns the function.</p>

<p><em>Updating my question with some things that I have tried so far based on responses here and elsewhere.</em></p>

<p>I ended up creating a select style function for each layer.</p>

<p>This doesn't work, no style is returned:</p>

<pre><code>selectInteraction = new ol.interaction.Select( {
    style: function( feature, resolution ) {
        if ( feature.selectStyle ) {
            return feature.selectStyle;
        }
    },
    layers: mylayers
} );
</code></pre>

<p>Also, with the above I get the following error:</p>

<pre><code>Uncaught TypeError: style.getImage is not a function
    ol.renderer.vector.renderFeature                @ol.js:38455
    ol.renderer.canvas.VectorLayer.renderFeature    @ol.js:44202
    renderFeature                                   @ol.js:44148
    ol.renderer.canvas.VectorLayer.prepareFrame     @ol.js:44164
    ol.renderer.canvas.Map.renderFrame              @ol.js:45268
    ol.Map.renderFrame_                             @ol.js:52034
    (anonymous function)                            @ol.js:50898
</code></pre>

<p>This does work, the feature is rendered using my select style. However, I don't want to have to manage re-setting styles, so it really needs to be implemented in the selectInteraction: </p>

<pre><code>evt.selected.forEach( function( evt ) {
    evt.setStyle( evt.selectStyle );
}, this );
</code></pre>