flekschas / piling.js

A general framework and library for exploring thousands of small multiples

Home Page:https://piling.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arrangeBy never resolves if the arrangement does not change

flekschas opened this issue · comments

In a simple setting, like the following, where piling.arrangeBy(); does not lead to a position change. The returned Promise never resolves.

piling.subscribe('itemUpdate', async () => {
  // Piles are naturally ordered by year so the following call should not change the pile positions
  await piling.arrangeBy('data', 'year');
  // we will never get here because the arrangement never changed and `pilesPositionEnd` never fired
}, 1);