Created
October 25, 2018 05:17
-
-
Save gskachkov/5333d8352aed4c9290095bcd6754aff0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LayoutWorklet { | |
*intrinsicSizes() {} | |
*layout(children, edges, constraintSpace, styles) { | |
const childFragments = [] | |
console.log(constraintSpace); | |
for(const child of children) { | |
const childFragment = yield child.layoutNextFragment(); | |
console.log(childFragment); | |
childFragment.inlineOffset = Math.random() * constraintSpace.fixedInlineSize; | |
childFragment.blockOffset = Math.random() * constraintSpace.fixedBlockSize; | |
childFragments.push(childFragment); | |
} | |
return { | |
childFragments | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment