Skip to content

Commit 96a718f

Browse files
author
dutchenkoOleg
committed
docs
1 parent 68f8f57 commit 96a718f

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

docs/examples/abstract-class.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
* @version 0.0.1
88
*/
99

10+
// ----------------------------------------
11+
// Imports
12+
// ----------------------------------------
13+
1014
import $ from 'jquery'; // for example
1115
import 'some-jquery-plugin'; // for example
1216
import { WebPluginInterface } from 'web-plugin-interface';
1317

18+
// ----------------------------------------
19+
// Exports
20+
// ----------------------------------------
21+
1422
/**
1523
* @implements WebPluginInterface
1624
*/
@@ -93,9 +101,9 @@ export class SomeJqueryPluginAbstract extends WebPluginInterface {
93101
this._afterInitialize();
94102
}
95103

96-
// ------------------------------
104+
// ***********************************
97105
// Custom extend implemented interface
98-
// ------------------------------
106+
// ***********************************
99107

100108
/**
101109
* @type {boolean}

docs/examples/factory.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
'use strict';
2+
3+
/**
4+
* @module examples/abstract-class
5+
* @description Abstract class example with WebPluginInterface implementation
6+
* @author OlegDutchenko <[email protected]>
7+
* @version 0.0.1
8+
*/
9+
10+
// ----------------------------------------
11+
// Imports
12+
// ----------------------------------------
13+
14+
import { SomeJqueryPluginAbstract } from './abstract-class';
15+
16+
// ----------------------------------------
17+
// Exports
18+
// ----------------------------------------
19+
20+
// A
21+
export class FactoryA extends SomeJqueryPluginAbstract {
22+
/**
23+
* @type {Object}
24+
*/
25+
get defaultSettings () {
26+
return {
27+
autoplay: false,
28+
speed: 750,
29+
fade: true
30+
}
31+
}
32+
33+
/**
34+
* @type {Object}
35+
*/
36+
get defaultProps () {
37+
return {
38+
stopAutoPlayIfOutView: false
39+
}
40+
}
41+
}
42+
43+
44+
// B
45+
export class FactoryB extends SomeJqueryPluginAbstract {
46+
/**
47+
* @protected
48+
*/
49+
_afterInitialize () {
50+
super._afterInitialize();
51+
// individual extend
52+
// ...
53+
}
54+
55+
/**
56+
* @type {Object}
57+
*/
58+
get defaultSettings () {
59+
return {
60+
speed: 600
61+
}
62+
}
63+
}
64+
65+
// C
66+
// ...

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
1. [Interface](./interface.md)
99
1. Code examples
1010
- [examples/abstract-class](./examples/abstract-class.js)
11+
- [examples/factory](./examples/factory.js)

0 commit comments

Comments
 (0)