Re: [css-houdini-drafts] Improve potential for generating multiple animation frames in parallel

_From @birtles on April 9, 2018 13:39_

I wonder if we need an explicit flag or whether we can look at the shape of the passed-in animator to determine if it is stateful or stateless.

e.g. looking at the length of the constructor function:

```webidl
// Stateful
registerAnimator('stateful', class {
  constructor(options, state) {
  }
  animate(currentTime, effect) {
  }
});

// Stateless
registerAnimator('stateless', class {
  constructor(options) {
  }
  animate(currentTime, effect) {
  }
});
```

e.g. differentiate between function objects and generic objects

```webidl
// Stateful
registerAnimator('stateful', class {
  constructor(options, state) {
  }
  animate(currentTime, effect) {
  }
});

// Stateless
registerAnimator('stateless', (currentTime, effect) => {
  // ...
});
```

Or we could possibly even do both of the above.

-- 
GitHub Notification of comment by majido
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/812#issuecomment-417053896 using your GitHub account

Received on Wednesday, 29 August 2018 18:19:35 UTC