Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mqtt-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
mqtt-client
Commits
2973db64
Commit
2973db64
authored
Nov 16, 2020
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ClientImplementation add scope fn
parent
0357917a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
Client.js
es/Client.js
+1
-0
Client.js
lib/Client.js
+5
-3
ClientImplementation.js
src/ClientImplementation.js
+5
-0
No files found.
es/Client.js
View file @
2973db64
import
_typeof
from
"@babel/runtime/helpers/esm/typeof"
;
import
ClientImplementation
from
'./ClientImplementation'
;
import
{
ERROR
}
from
'./consts'
;
import
{
validate
}
from
'./utils'
;
/* eslint-disable */
var
Client
=
function
Client
(
host
,
port
,
path
,
clientId
)
{
...
...
lib/Client.js
View file @
2973db64
...
...
@@ -13,6 +13,8 @@ var _ClientImplementation = _interopRequireDefault(require("./ClientImplementati
var
_consts
=
require
(
"./consts"
);
var
_utils
=
require
(
"./utils"
);
/* eslint-disable */
var
Client
=
function
Client
(
host
,
port
,
path
,
clientId
)
{
var
uri
;
...
...
@@ -226,7 +228,7 @@ var Client = function Client(host, port, path, clientId) {
this
.
connect
=
function
(
connectOptions
)
{
connectOptions
=
connectOptions
||
{};
validate
(
connectOptions
,
{
(
0
,
_utils
.
validate
)
(
connectOptions
,
{
timeout
:
'number'
,
userName
:
'string'
,
password
:
'string'
,
...
...
@@ -348,7 +350,7 @@ var Client = function Client(host, port, path, clientId) {
this
.
subscribe
=
function
(
filter
,
subscribeOptions
)
{
if
(
typeof
filter
!==
'string'
&&
filter
.
constructor
!==
Array
)
throw
new
Error
(
'Invalid argument:'
+
filter
);
subscribeOptions
=
subscribeOptions
||
{};
validate
(
subscribeOptions
,
{
(
0
,
_utils
.
validate
)
(
subscribeOptions
,
{
qos
:
'number'
,
invocationContext
:
'object'
,
onSuccess
:
'function'
,
...
...
@@ -392,7 +394,7 @@ var Client = function Client(host, port, path, clientId) {
this
.
unsubscribe
=
function
(
filter
,
unsubscribeOptions
)
{
if
(
typeof
filter
!==
'string'
&&
filter
.
constructor
!==
Array
)
throw
new
Error
(
'Invalid argument:'
+
filter
);
unsubscribeOptions
=
unsubscribeOptions
||
{};
validate
(
unsubscribeOptions
,
{
(
0
,
_utils
.
validate
)
(
unsubscribeOptions
,
{
invocationContext
:
'object'
,
onSuccess
:
'function'
,
onFailure
:
'function'
,
...
...
src/ClientImplementation.js
View file @
2973db64
...
...
@@ -28,6 +28,11 @@ const Timeout = function (client, timeoutSeconds, action, args) {
clearTimeout
(
this
.
timeout
);
};
};
const
scope
=
function
(
f
,
scope
)
{
return
function
()
{
return
f
.
apply
(
scope
,
arguments
);
};
};
/* eslint-disable */
const
ClientImplementation
=
function
(
uri
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment