1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | require('./polyfill');
|
7 |
|
8 | const _on = require('./on');
|
9 |
|
10 | const _send = require('./send');
|
11 |
|
12 | const _subscribe = require('./subscribe');
|
13 |
|
14 | const state = require('./state');
|
15 |
|
16 | const _unsubscribe = require('./unsubscribe');
|
17 |
|
18 | module.exports = function httpProvider(endpoint) {
|
19 | const self = state(endpoint);
|
20 | return {
|
21 | isConnected: () => true,
|
22 | on: (type, sub) => _on(self, type, sub),
|
23 | send: (method, params) => _send(self, method, params),
|
24 | subscribe: (method, params, cb) => _subscribe(self, method, params, cb),
|
25 | unsubscribe: (method, id) => _unsubscribe(self, method, id)
|
26 | };
|
27 | }; |
\ | No newline at end of file |