Comments (4)
Nice find! And very good reporting. I do undertand the issue.
Do you have any code that fixes the problem? Anything you can post here?
Otherwise you could maybe post a reproduce senario or something?
Olof
from react-native-signalr.
The way I solved it was to move the line const events = subject.events || {};
to the inside of every emulated jquery function (unbind, bind, triggerhandler) like this:
`unbind(event, handler) {
const events = subject.events || {};
let handlers = events[event] || [];
if (handler) {
const idx = handlers.indexOf(handler);
if (idx !== -1) {
handlers.splice(idx, 1);
}
} else {
handlers = [];
}
events[event] = handlers;
subject.events = events;
},
bind(event, handler) {
const events = subject.events || {};
const current = events[event] || [];
events[event] = current.concat(handler)
subject.events = events;
},
triggerHandler(event, args) {
const events = subject.events || {};
const handlers = events[event] || [];
handlers.forEach(fn => {
if (args === undefined) {
args = { type: event };
}
if (!Array.isArray(args)) {
args = [args];
}
if (args && args[0] && args[0].type === undefined) {
args = [{
type: event
}].concat(args || []);
} else {
args = args || [];
}
fn.apply(this, args);
});
}`
After these changes, everything worked just fine.
from react-native-signalr.
Ah! Great, than I understood you correctly.
I did a change here last night before pushing the new version.
I did not do any difference for basic functionality, so I included what I thought might work.
Can you take a look here:
https://github.com/olofd/react-native-signalr/blob/master/src/jquery-function.js#L16
And test out the new version on npm that the problem is solved?
from react-native-signalr.
Hi again :)
Unfortunately with the new version I have another error when connecting to SignalR: "method GET must not have a request body"
I traced it to this line in ajax.js
request.send(options.data && qs(options.data));
It seems options.data is an empty object and it's always true, so it will try to send an empty body, even when there is no body to be sent.
If I set options.data = null before this call, it works correctly.
Can you check this out? Thanks for the work!
from react-native-signalr.
Related Issues (20)
- how can change state from on(event) HOT 1
- .NET core 2.0 support
- How is reconnection handled? HOT 3
- IOS - SignalR Connection break when app move in background. HOT 4
- Does it support Net Core 2.1 or later?
- get 'undefined' from server in invoke
- cannot receive message HOT 1
- Timer Error HOT 1
- Try specifying a different transport or none at all for auto initialization.
- How to send token or other data HOT 3
- Signal R not working with ANDROID STORE VERSION
- Unable to call signalR method
- Replace deprecated dependency ms-signalr-client HOT 1
- Failed - Error: Error during negotiation request. HOT 3
- Autoreconnect feature HOT 1
- TypeError: Cannot set property userAgent of #<Navigator> which has only a getter HOT 1
- hello
- Forgotten Package
- On Screen Change, Event Is Still fired HOT 7
- is this lib dead? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-signalr.