Skip to content

Commit fca4e1a

Browse files
Merge pull request #10 from dutchenkoOleg/master
3.1.0
2 parents a28ae43 + 44e7c1e commit fca4e1a

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

docs/examples/abstract-class.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export class SomeJqueryPluginAbstract extends WebPluginInterface {
6464
* @protected
6565
*/
6666
_setup () {
67-
this.props = $.extends({}, this.defaultProps, this.clientProps);
68-
this.settings = $.extends({}, this.defaultSettings, this.clientSettings);
67+
this.props = $.extend({}, this.defaultProps, this.clientProps);
68+
this.settings = $.extend({}, this.defaultSettings, this.clientSettings);
6969

7070
// props example
7171
if (this.props.stopAutoPlayIfOutView) {
@@ -92,13 +92,17 @@ export class SomeJqueryPluginAbstract extends WebPluginInterface {
9292
}
9393
}
9494

95+
/**
96+
* @protected
97+
*/
98+
_initialize () {
99+
this.$container.someJqueryPlugin(this.settings);
100+
}
101+
95102
initialize () {
96103
this._setup();
97104
this._beforeInitialize();
98-
99-
// fire up
100-
this.$container.someJqueryPlugin(this.settings);
101-
105+
this._initialize();
102106
this._afterInitialize();
103107
}
104108

docs/interface.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [`_setup()`](#_setup)
1212
- [`_beforeInitialize()`](#_beforeinitialize)
1313
- [`_afterInitialize()`](#_afterinitialize)
14+
- [`_initialize()`](#_initialize)
1415
- [`initialize()`](#initialize)
1516

1617

@@ -61,11 +62,28 @@ _`protected`_
6162
Here we can describe the actions that should be performed after the initialization of the plugin.
6263
For example, add an additional handler to scroll or resize window events, which will update the parameters of your current plugin.
6364

65+
### `_initialize()`
66+
67+
_`private`_
68+
69+
Directly launch your plugin.
70+
6471
### `initialize()`
6572

6673
_`public`_
6774

68-
Directly launch your plugin.
75+
Public start-runner method
76+
77+
_example_
78+
79+
```js
80+
initialize() {
81+
this._setup();
82+
this._beforeInitialize();
83+
this._initialize();
84+
this._afterInitialize();
85+
}
86+
```
6987

7088
---
7189

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ export class WebPluginInterface {
4949
// code
5050
}
5151

52+
/**
53+
* @protected
54+
*/
55+
_initialize () {
56+
// code
57+
}
58+
59+
/**
60+
* @public
61+
*/
5262
initialize () {
5363
// code
5464
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-plugin-interface",
3-
"version": "3.0.3",
3+
"version": "3.1.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)