camo
camo copied to clipboard
Why use .create() for instantiation?
So from the examples I see that we need to use Class.create()
method to create a new
instance is there a reason why this can't be handled in Document
constructor,
so we could use it like this let newClass = new Class();
since we already call super
either way?
This is a good question. I originally had to use .create()
because in the first few versions of Camo it was using Proxies underneath. The proxy had to be set up on an object instance and not the class object. So .create()
was used to set up the Proxy and has been carried over from those older versions.
Now that proxies aren't being used anymore, .create()
probably isn't required. I'll look in to it and possibly deprecate it in the next version.
Thanks for bringing this up!
Awesomesauce!
+1
Any idea when this will be released?