MCPcopy Index your code
hub / github.com/microsoft/SandDance / addAsyncPropsToPropPrototype

Function addAsyncPropsToPropPrototype

docs/app/js/sanddance-app.js:88060–88074  ·  view source on GitHub ↗
(defaultProps, propTypes)

Source from the content-addressed store, hash-verified

88058 for(var propName1 in deprecatedProps)_loop(propName1);
88059}
88060function addAsyncPropsToPropPrototype(defaultProps, propTypes) {
88061 var defaultValues = {};
88062 var descriptors = {};
88063 for(var propName in propTypes){
88064 var propType = propTypes[propName];
88065 var name = propType.name, value = propType.value;
88066 if (propType.async) {
88067 defaultValues[name] = value;
88068 descriptors[name] = getDescriptorForAsyncProp(name, value);
88069 }
88070 }
88071 defaultProps[ASYNC_DEFAULTS] = defaultValues;
88072 defaultProps[ASYNC_ORIGINAL] = {};
88073 Object.defineProperties(defaultProps, descriptors);
88074}
88075function getDescriptorForAsyncProp(name) {
88076 return {
88077 enumerable: true,

Callers 1

Calls 1

Tested by

no test coverage detected