Skip to content

Commit

Permalink
Import keyword added
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo Herrera committed Jul 30, 2021
1 parent d9cfdad commit 694aef7
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 110 deletions.
Binary file modified Zenda
Binary file not shown.
9 changes: 9 additions & 0 deletions examples/import/library.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const SayHelloWithPython = () => {
pythonString("print('Hello world')");
}

export const MyVar = "Hello";

export function MyFunction(){
console.log('Hello');
}
18 changes: 18 additions & 0 deletions examples/import/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Static Import
import { SayHelloWithPython, MyVar, MyFunction } from "./examples/import/library.js";

SayHelloWithPython(); // Calling the function from other file =D

console.log(MyVar);

MyFunction();

// Dynamic Import
import('./examples/import/library.js')
.then((module) => {
module.SayHelloWithPython(); // Calling the function using module parameter =D

console.log(module.MyVar);

MyFunction();
});
4 changes: 2 additions & 2 deletions examples/misc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Sleep -> Wait seconds for next instruction
sleep(.5); // 1 second / 2
// Sleep -> Wait milliseconds for next instruction
sleep(1000); // 1 second / 500 = 500 ms

// Creator -> Get Creator information
creator();
Expand Down
Loading

0 comments on commit 694aef7

Please sign in to comment.