Would you like to clone this notebook?

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

Cancel

@bem.decl: subtracting declarations

node v10.24.1
version: 1.0.3
endpointsharetweet
Substract 'b' and 'c' from ['a', 'b', 'c']
const BemDecl = require('@bem/sdk.decl'); const BemCell = require('@bem/sdk.cell'); const BemEntityName = require('@bem/sdk.entity-name'); const set1 = [ new BemCell({ entity: new BemEntityName({ block: 'a' }) }), new BemCell({ entity: new BemEntityName({ block: 'b' }) }), new BemCell({ entity: new BemEntityName({ block: 'c' }) }) ]; const set2 = [ new BemCell({ entity: new BemEntityName({ block: 'b' }) }), ]; const set3 = [ new BemCell({ entity: new BemEntityName({ block: 'c' }) }) ]; BemDecl.subtract(set1, set2, set3).map(c => c.id);
Loading…

no comments

    sign in to comment