@bem.decl: merging declarations

node v10.16.0
version: 1.0.0
endpointsharetweet
Merge [ 'a' ], [ 'b', 'c' ], [ 'a', 'b', 'd' ]
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' }) }) ]; const set2 = [ new BemCell({ entity: new BemEntityName({ block: 'b' }) }), new BemCell({ entity: new BemEntityName({ block: 'c' }) }) ]; const set3 = [ new BemCell({ entity: new BemEntityName({ block: 'a' }) }), new BemCell({ entity: new BemEntityName({ block: 'b' }) }), new BemCell({ entity: new BemEntityName({ block: 'd' }) }) ]; BemDecl.merge(set1, set2, set3).map(c => c.id);
Loading…

no comments

    sign in to comment