Skip to content
This repository has been archived by the owner on Jan 13, 2018. It is now read-only.

Add ability to write level config module as a function (closes #364, BEM-931) #430

Merged
merged 2 commits into from
Sep 12, 2013

Conversation

scf2k
Copy link
Contributor

@scf2k scf2k commented Aug 19, 2013

No description provided.

@@ -8,8 +8,18 @@ var PATH = require('./path'),
LOGGER = require('./logger'),
isRequireable = bemUtil.isRequireable,

BEM,
getBem = function() {
if (!BEM) BEM = require('..');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У require же свой кеш есть.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я знаю, не стал полагаться на то что он такой же легкий.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проверил: действительно твой вариант гораздо быстрее.

@scf2k
Copy link
Contributor Author

scf2k commented Sep 10, 2013

/сс @arikon

getLevelClass = function(path, optional) {
var level = optional && !isRequireable(path) ? {} : requireLevel(path);

if (typeof level === 'function') level = level(getBem());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Напиши в комментариях в коде суть решения с getBem(). Я её понимаю, но кто-то при свежем взгляде в код может не понять.

@scf2k
Copy link
Contributor Author

scf2k commented Sep 12, 2013

Мне кажется эту фичу можно/нужно влить в 0.6 тоже?

scf2k added a commit that referenced this pull request Sep 12, 2013
Add ability to write level config module as a function (closes #364, BEM-931)
@scf2k scf2k merged commit 40074a6 into release-1.0.0 Sep 12, 2013
@scf2k scf2k deleted the BEM-931 branch September 12, 2013 13:14
scf2k added a commit that referenced this pull request Sep 16, 2013
Add ability to write level config module as a function (closes #364, BEM-931)
scf2k added a commit that referenced this pull request Sep 16, 2013
backport: Merge pull request #430 from bem/BEM-931
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants