Re: [w3c/webcomponents] CSS Modules (#759)

I think @dfabulich is right:

```js
arr = ['a'];

function resolveAfter (value, ms) {
  return new Promise(f => setTimeout(() => f(value), ms));
}

async function addB() {
  arr = [...arr, await resolveAfter('b', 100)];
}

async function addC() {
  arr = [...arr, await resolveAfter('c', 50)];
}

addB();
addC();

// later...
console.log(arr); // ['a', 'b']
```

This is a strong argument in favour of having an interface for adding and removing styles, rather than using an array literal, which is likely to result in some unpleasant bugs for this reason.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/759#issuecomment-521079347

Received on Wednesday, 14 August 2019 02:34:50 UTC