Code Monkey home page Code Monkey logo

Comments (6)

ap1969 avatar ap1969 commented on July 21, 2024 1

Hi Sean,
Yes, I just noticed that browser with bound methods line. Excellent. Wails is really well written.

I'll take a look at that repo - thanks for sharing.

Andy

from wails-template-quasar-js.

ap1969 avatar ap1969 commented on July 21, 2024

I should add that in the dev console, runtime.js is being loaded ONLY if I import it, otherwise I can't see it.

from wails-template-quasar-js.

ap1969 avatar ap1969 commented on July 21, 2024

I've also just tried:

import { EventsOn } from '../../wailsjs/runtime/runtime';
onMounted(() => {
  try {
    EventsOn('test', function (data) {
      console.log('Timer', data);
    });
  } catch (err) {
    console.log('Error', err);
  }
});

But again get "Cannot read properties of undefined (reading 'EventsOnMultiple')"

from wails-template-quasar-js.

ap1969 avatar ap1969 commented on July 21, 2024

Ignore me! I'm a complete doofus.

I was running the app in my browser, which obviously doesn't have access to the go runtime.

Doh!

from wails-template-quasar-js.

sgosiaco avatar sgosiaco commented on July 21, 2024

Ah glad you were able to figure it out.
For future reference, there's that other url/port that gets printed when you run wails dev that looks like this

To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115

If you go to that specific url you will have access to the go runtime

from wails-template-quasar-js.

sgosiaco avatar sgosiaco commented on July 21, 2024

And here's an example repo as well if you want to see how I'd use the events between go and JS.
This example sets up a simple goroutine to send over an event every second and the JS part just updates a ref which is shown in the app.

sgosiaco/wails-quasar-events-example@e3b8d06

from wails-template-quasar-js.

Related Issues (2)

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.