Re: [css-houdini-drafts] Pure/idempotent representation

I agree that the idempotency requirement needs to be documented particularly once we start writing a spec but perhaps it is worth a mention in explainer as well. 

Thanks for pointing out the React conventions. It definitely helps to understand well established patterns when designing the API. In particular, if we support plain Javascript functions similar to [React stateless functions](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) we may be able to avoid having an entry for them in the instance map which is nice. This means we invoke the registered function with this bound to the worklet global scope.

Do you know how React detects if the component is statefull or stateless? I suppose it can do that by looking at the object prototype and seeing if it extends `React.Component` (Is there anyway to create a statefull component without extending React.Component?). We may be able to do something similar if we require all animators to extend a base class.


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

Received on Wednesday, 29 August 2018 18:18:47 UTC