Skip to content

Docs broadcasting not working example #238

@pkristian

Description

@pkristian

Discovered not working code example:

https://nativephp.com/docs/desktop/2/digging-deeper/broadcasting#listening-with-javascript

example provided:

window.addEventListener('native:init', () => {
 
    Native.on('Native\\Desktop\\Events\\Windows\\WindowBlurred', (payload, event) => {
        //
    })
 
    //
})

Following steps to reproduce:

in foo.blade.php: @vite(['resources/js/app.js'])

test code in app.js:

console.info('Blur Test!');

Native.on('Native\\Desktop\\Events\\Windows\\WindowBlurred', (payload, event) => {
    console.info('work!');
});

window.addEventListener('native:init', () => {
    Native.on('Native\\Desktop\\Events\\Windows\\WindowBlurred', (payload, event) => {
        console.info('does not work!');
    })
})

console output:
Image

version: nativephp/desktop: "2.0.2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions