Code Monkey home page Code Monkey logo

Comments (9)

fuleshu avatar fuleshu commented on August 21, 2024 1

when I run:
npm install naderio/nativescript-socket.io#master
it only create the following files in the nativescript-socket.io directory:

d----        01.12.2016     15:54            platforms
-a---        01.12.2016     15:54         84 .npmignore
-a---        01.12.2016     15:54        790 common.d.ts
-a---        01.12.2016     15:54        112 helpers.d.ts
-a---        01.12.2016     15:54       1234 LICENSE.md
-a---        01.12.2016     15:54      14792 package.json
-a---        01.12.2016     15:54       9783 README.md
-a---        01.12.2016     15:54        730 socket.d.ts

but when I run npm install nativescript-socket.io it installs:

d----        01.12.2016     16:12            platforms
-a---        01.12.2016     16:12         75 .npmignore
-a---        01.12.2016     16:12        773 common.d.ts
-a---        01.12.2016     16:12       1381 common.js
-a---        01.12.2016     16:12       2134 helpers.android.js
-a---        01.12.2016     16:12        110 helpers.d.ts
-a---        01.12.2016     16:12       1566 helpers.ios.js
-a---        01.12.2016     16:12       1210 LICENSE.md
-a---        01.12.2016     16:12       2886 package.json
-a---        01.12.2016     16:12       9215 README.md
-a---        01.12.2016     16:12       6229 socket.android.js
-a---        01.12.2016     16:12        706 socket.d.ts
-a---        01.12.2016     16:12       5601 socket.ios.js

But I see that you changes the default version, so running the later now installs 0.4.0 and not 0.3.0 anymore.
So I installed it using tns plugin add nativescript-socket.io again and now that it uses 0.4.0 everything works fine.
Featherjs now runs without problems.
Thanks a lot!!!

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

well, try this until .once() is implemented

const SocketIO = require('nativescript-socket.io');

SocketIO.Socket.prototype.once = function(event, fn){
  function on() {
    this.off(event, on);
    fn.apply(this, arguments);
  }
  on.fn = fn;
  this.on(event, on);
  return this;
};

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

probably Emitter#listeners(event) and Emitter#hasListeners(event) need to be implemented as well

from nativescript-socket.io.

fuleshu avatar fuleshu commented on August 21, 2024

thanks for your fast reply.
I am using typescript and unfortunately typescript does not compile it:
app/utils/feathers.service.ts(27,16): error TS2339: Property 'fn' does not exist on type '() => void'.
This is the point where my javascript/typescript understanding is not deep enough...

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

that's expected with TypeScript
try removing the on.fn = fn; instruction then .. or change it to (<any>on).fn = fn;

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

@fuleshu check latest on master please

from nativescript-socket.io.

fuleshu avatar fuleshu commented on August 21, 2024

Thanks for the fast fix!
Unfortunately I did not manage to test it because I just couldn't get the master version running in my app. Using the tns plugin installer installs version 0.3.0. I tried several ways I found in the net to get the latest github version into the node_modules, also tried cloning the repro there directly. But non of them would get the code working in my app :(

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

npm install naderio/nativescript-socket.io#master then tns run android or tns run ios
I've run the demo app successfully

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

@fuleshu recheck no please

from nativescript-socket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.