File tree Expand file tree Collapse file tree 3 files changed +77
-2
lines changed
Expand file tree Collapse file tree 3 files changed +77
-2
lines changed Original file line number Diff line number Diff line change 77 * @version 0.0.1
88 */
99
10+ // ----------------------------------------
11+ // Imports
12+ // ----------------------------------------
13+
1014import $ from 'jquery' ; // for example
1115import 'some-jquery-plugin' ; // for example
1216import { 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 }
Original file line number Diff line number Diff line change 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+ // ...
Original file line number Diff line number Diff line change 881 . [ Interface] ( ./interface.md )
991 . Code examples
1010 - [ examples/abstract-class] ( ./examples/abstract-class.js )
11+ - [ examples/factory] ( ./examples/factory.js )
You can’t perform that action at this time.
0 commit comments