graph: Specify a technology for the created vertex

node v10.15.3
version: 1.0.1
endpointsharetweet
const { BemGraph } = require('@bem/sdk.graph'); const graph = new BemGraph(); graph.vertex({ block: 'a' }) .dependsOn({ block: 'b' }); graph.vertex({ block: 'a' }, 'css') .dependsOn({ block: 'c' }); graph.dependenciesOf({ block: 'a'}); // => [ // {"entity":{"block":"b"}}, // {"entity":{"block":"a"}}, // ]
graph.dependenciesOf({ block: 'a'}, 'js'); // => [ // {"entity":{"block":"b"},"tech":"js"}, // {"entity":{"block":"a"},"tech":"js"} // ]
graph.dependenciesOf({ block: 'a'}, 'css'); // => [ // {"entity":{"block":"c"},"tech":"css"}, // {"entity":{"block":"b"},"tech":"css"}, // {"entity":{"block":"a"},"tech":"css"} // ]
Loading…

no comments

    sign in to comment