Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

graph: Specify a technology for the created vertex

node v10.24.1
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