An example is an init function. A work around is to early out after the first run, but it would be even better if it were just removed from the sort entirely.
I figure the API can look like this, though I don't know the best way it could be implemented.
test('scheduling runnables once', () => {
const schedule = create();
add(schedule, aFn, id('A'), once());
add(schedule, bFn, after('A'), id('B'));
add(schedule, cFn, after('B'), id('C'));
run(schedule, {});
expect(order).toEqual(['A', 'B', 'C']);
order = [];
run(schedule, {});
expect(order).toEqual(['B', 'C']);
})
An example is an init function. A work around is to early out after the first run, but it would be even better if it were just removed from the sort entirely.
I figure the API can look like this, though I don't know the best way it could be implemented.