Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
@bem.decl: intersecting declarations
node v10.24.1
version:
1.0.1
endpoint
share
tweet
Create sets with a common block 'a' in all sets.
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' }) }) ]; const set2 = [ new BemCell({ entity: new BemEntityName({ block: 'a' }) }), new BemCell({ entity: new BemEntityName({ block: 'c' }) }) ]; const set3 = [ new BemCell({ entity: new BemEntityName({ block: 'a' }) }), new BemCell({ entity: new BemEntityName({ block: 'e' }) }) ]; BemDecl.intersect(set1, set2, set3).map(c => c.id);
Loading…
no comments
sign in
to comment