We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asynchronous attributes typically hard to operate them. We need feature to handle asynchronous attributes easily.
If an converter returned a Promise instance, Attribute#value should be resolved value. For example, material is asynchronous attribute.
Attribute#value
material
function convertMaterial(){ return new Promise((resolve,reject)=>{ // SOMETHING resolve(new Material(....)); }); }
Before this feature
NodeInterface#getAttribute("material") => Promise<Material>;
After this feature
NodeInterface#getAttribute("material") => Material;
For changing this feature, we need define several APIs.
watch API also should be fired when the attribute was resolved.
watch("material",(mat:Material)=>{ // mat should be Material instance. not Promise. });
if immediate flag is set, the watch function is fired after resolving current Promise.
immediate
isPending provides information that specified attribute is waiting for Promise or not.
Component#isPending(attributeName:string):boolean;
These method should return Promise instance that is currently waiting for.
NodeInterface#setAttribute("material",something)=>void;
NodeInterface#setAttribute("material",something)=>Promise<Material>;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Asynchronous attributes typically hard to operate them. We need feature to handle asynchronous attributes easily.
Change behaviour of fetching attribute if the attribute converter returned Promise.
If an converter returned a Promise instance,
Attribute#value
should be resolved value.For example,
material
is asynchronous attribute.Before this feature
After this feature
Several API changes
For changing this feature, we need define several APIs.
watch API
watch API also should be fired when the attribute was resolved.
if
immediate
flag is set, the watch function is fired after resolving current Promise.isPending API
isPending provides information that specified attribute is waiting for Promise or not.
NodeInterface#setAttribute, Component#setAttribute
These method should return Promise instance that is currently waiting for.
Before this feature
After this feature
The text was updated successfully, but these errors were encountered: