Last active
December 3, 2021 08:04
-
-
Save RahulDas-dev/ae0fce38a2c51f5ef6800a3876dc3974 to your computer and use it in GitHub Desktop.
How To trigger commands from Frontend to change the state object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private registerListeners() { | |
appWindow.listen('config-init', event => { | |
console.log('registerListeners :', event.payload, event.event) | |
}) | |
appWindow.listen('page-loaded', event => { | |
//console.log('page-loaded :', event.payload, event.event) | |
appWindow.show() | |
}) | |
appWindow.once('tauri://close-requested', this.window_close_handeler) | |
appWindow.once('tauri://destroyed', this.window_close_handeler) | |
appWindow.listen('tauri://resize', ({ event, payload }) => { | |
console.log('resize event trigered :', payload, event) | |
const { width, height } = payload as PhysicalSize | |
invoke('plugin:config|change_dimension', { height: height, width: width }) | |
}) | |
appWindow.listen('tauri://move', ({ event, payload }) => { | |
const { x, y } = payload as PhysicalPosition | |
console.log('Move event trigered :', x, y) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment