-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.js
46 lines (40 loc) · 1.31 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* # Fabric: an experimental p2p framework
* Providing an interface to Fabric network, this file defines the available
* components and abstractions used when relying on this library.
*/
'use strict';
const Fabric = require('./types/fabric');
/**
* Default interface to {@link Fabric}. Provides immutable types for all
* elements of the `components` option.
* @property {Configuration} config Initial {@link Vector}.
* @property {Map} config.components Transformation function of `Σ ⇒ Δ`.
*/
class FabricApplication extends Fabric {
/**
* Create a new instance of the Fabric Application.
* @param {Object} [config] Configuration object.
* @param {Object} [config.store] Path to local storage.
* @param {Object} [config.components] Map of components.
* @param {Object} [config.components.list] Name of "list" component.
* @param {Object} [config.components.view] Name of "view" component.
* @return {FabricApplication}
*/
constructor (config) {
super(config);
// Store the configuration
this.config = Object.assign({
store: `./stores/${this.constructor.name.toLowerCase()}`
}, config);
return this;
}
/**
* Draw the application to canvas (display).
* @return {Mixed}
*/
render () {
return `<Fabric />`;
}
}
module.exports = FabricApplication;