2.0.1 • Published 4 years ago

@lightsource/bem-block v2.0.1

Weekly downloads
5
License
GPL-2.0-only
Repository
gitlab
Last release
4 years ago

Bem block

What is it

Helper for BEM blocks, it will be auto creating instances per each block, supports dynamic content (like ajax) thanks to MutationObserver.

Installation

yarn add @lightsource/bem-block

OR

npm install @lightsource/bem-block

Example of usage

import bemBlock from '@lightsource/bem-block';

class Start extends bemBlock.Class {


    //////// constructor


    constructor(element) {

        super(element);

        // TODO add listeners, etc..

    }

}

bemBlock.Register('.start', Start);

Also an error callback is available (e.g. for cases when a passed class link is wrong)

bemBlock.settings.ERROR_CALLBACK = function (errors) {

// TODO

}; 
2.0.1

4 years ago

2.0.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago