<div dir="ltr"><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px;margin-top:0px!important">Hi all,</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px">Some days ago I implemented async calls with promises. So the calls change from this:</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px"><strong>Older version</strong>, sync and blocking method:</p><div class="" style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px;overflow:visible!important"><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.8999996185303px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;word-break:normal;background-color:rgb(247,247,247)"><span class="" style="color:rgb(150,152,150)">// GetRecords</span>
<span class="" style="color:rgb(167,29,93)">var</span> results <span class="" style="color:rgb(167,29,93)">=</span> csw.GetRecords(<span class="" style="color:rgb(0,134,179)">1</span>,<span class="" style="color:rgb(0,134,179)">10</span>,filter);
<span class="" style="color:rgb(121,93,163)">console</span><span class="" style="color:rgb(0,134,179)">.log</span>(results);</pre></div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px">to this:</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px"><strong>New version</strong>, async and no-blocking method:</p><div class="" style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px;overflow:visible!important"><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.8999996185303px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;word-break:normal;background-color:rgb(247,247,247)"><span class="" style="color:rgb(150,152,150)">// GetRecords</span>
csw.GetRecords(<span class="" style="color:rgb(0,134,179)">1</span>,<span class="" style="color:rgb(0,134,179)">10</span>,filter).then(<span class="" style="color:rgb(167,29,93)">function</span>(<span class="">result</span>){
        <span class="" style="color:rgb(121,93,163)">console</span><span class="" style="color:rgb(0,134,179)">.log</span>(result)
    });</pre></div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px">The code can by re-viewed at <a href="https://github.com/juanmav/ows.js/tree/promises" style="color:rgb(64,120,192);text-decoration:none;background-color:transparent">https://github.com/juanmav/ows.js/tree/promises</a></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px">any comments?</p><p style="margin-top:0px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px;margin-bottom:0px!important">Regards<br>JM</p></div>