From eb2f1731979c0f840102f397f45a0836411197ab Mon Sep 17 00:00:00 2001 From: Alex Wohlbruck Date: Thu, 16 Apr 2020 02:40:16 -0400 Subject: [PATCH 1/3] Update README.md Give example for custom function names for eel.expose --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7074d8f2..e399ce19 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ Eel is designed to take the hassle out of writing short and simple GUI applicati - [Directory Structure](#directory-structure) - [Starting the app](#starting-the-app) - [App options](#app-options) - - [Chrome/Chromium flags](#chromechromium-flags) - [Exposing functions](#exposing-functions) - [Eello, World!](#eello-world) - [Return values](#return-values) @@ -145,6 +144,12 @@ print('Calling Javascript...') eel.my_javascript_function(1, 2, 3, 4) # This calls the Javascript function ``` +The exposed name can also be specified with in a second argument. If your app minifies code during builds, you can use this to ensure that your functions will still be resolved on the Python side... + +```javascript +eel.expose(someFunction, "my_javascript_function"); +``` + When passing complex objects as arguments, bear in mind that internally they are converted to JSON and sent down a websocket (a process that potentially loses information). ### Eello, World! From efebc5ff2ea5733babb3e93348b6c6bd5b644aa0 Mon Sep 17 00:00:00 2001 From: Alex Wohlbruck Date: Thu, 16 Apr 2020 02:47:15 -0400 Subject: [PATCH 2/3] Update README.md Readd accidentally deleted line --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e399ce19..eae12261 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Eel is designed to take the hassle out of writing short and simple GUI applicati - [Directory Structure](#directory-structure) - [Starting the app](#starting-the-app) - [App options](#app-options) + - [Chrome/Chromium flags](#chromechromium-flags) - [Exposing functions](#exposing-functions) - [Eello, World!](#eello-world) - [Return values](#return-values) From 4a5889da73bb4a4d610f9d361328d0511fb87eda Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 16 Apr 2020 10:57:08 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eae12261..376249e0 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ print('Calling Javascript...') eel.my_javascript_function(1, 2, 3, 4) # This calls the Javascript function ``` -The exposed name can also be specified with in a second argument. If your app minifies code during builds, you can use this to ensure that your functions will still be resolved on the Python side... +The exposed name can also be overridden by passing in a second argument. If your app minifies JavaScript during builds, this may be necessary to ensure that functions can be resolved on the Python side: ```javascript eel.expose(someFunction, "my_javascript_function");