How to use typeflex - 1 common examples

To help you get started, we’ve selected a few typeflex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github the-expanse / aframe-material-collection / src / yoga-worker.ts View on Github external
ctx.addEventListener('message', event => {
    switch(event.data.type){

        case "add-node":
            let properties = event.data.properties;
            let node = Node.create() as any;
            nodes[event.data.uuid] = {
                uuid:event.data.uuid,
                node:node,
                parent:null,
                children:[],
                width:event.data.width
            };

            for(let method in properties){
                if(properties.hasOwnProperty(method)&&method.indexOf('Edge')===-1){
                    if(["setMarginLeft","setMarginPercentLeft","setPaddingLeft","setBorderLeft","setPositionLeft","setPositionPercentLeft"]
                        .indexOf(method)>-1){
                        node[method.replace('Left','')](EDGE_LEFT,properties[method]);
                    }else if(["setMarginRight","setMarginPercentRight","setPaddingRight","setBorderRight","setPositionRight","setPositionPercentRight"]
                        .indexOf(method)>-1){
                        node[method.replace('Right','')](EDGE_RIGHT,properties[method]);

typeflex

Typescript implementation of CSS flexbox layout algorithm, a pure typescript port of Facebook's Yoga

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular typeflex functions