The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

6780 (1) [Avatar] Offline
#1
Wrapping Pasta.apply(..) into the requestAnimationFrame function is not producing the desirable effect: initial photo is not shown when the page loads.
394895 (2) [Avatar] Offline
#2
Hi -
I had the same problem - copied the code from the book

app.ports.applyFilters.subscribe(function(options) {
  requestAnimationFrame(function() {
    Pasta.apply(document.getElementById("main-canvas"), options);
  });
});


but the port is named "setFilters" not "applyFilters".

so when using
app.ports.setFilters
it actually works for me - with Firefox and Chrome.