Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to BemCell.create and BemEntityName.create #113

Open
skad0 opened this issue May 12, 2017 · 4 comments
Open

Move to BemCell.create and BemEntityName.create #113

skad0 opened this issue May 12, 2017 · 4 comments

Comments

@skad0
Copy link
Member

skad0 commented May 12, 2017

Now we have deprecation messages when we use a constructor for BemCell and provide to it modName and modVal fields

@qfox
Copy link
Contributor

qfox commented May 12, 2017

We should not use .create here ;-)

@skad0
Copy link
Member Author

skad0 commented May 12, 2017

Ok, i understand that .create can't guarantee correct interpretation, but is current constructor ok? Is it convenient to pass every time as

const ob = {};
ob.block = entity.modName;
if (entity.modName) {
  ob.mod = {};
  ob.mod.name = entity.modName;
  ob.mod.val = entity.modVal;
}
const lala = new BemEntityName({ entity: ob, tech: entity.tech });

or smth like that?

@qfox
Copy link
Contributor

qfox commented May 12, 2017

new BemCell({
  entity: new BemEntityName({
    block: entity.block,
    elem: entity.elem,
    mod: entity.modName
      ? { name: entity.modName, val: enrity.modVal }
      : undefuned
  }),
  tech: entity.tech
})

Like that?

@skad0
Copy link
Member Author

skad0 commented May 14, 2017

looks ugly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants