Comments (7)
also I added a little bit API spec 60282e
.
What do you think about it?
from kotlin-playground.
I don't think it's a kotlin playground component issue. It's just a plain component to embed in websites for running code. It should not have to adapt to each client.
However you could add the new event
function you want.
from kotlin-playground.
However you could add the new event function you want.
I don't understand what you mean.
It's not about adapting to each client. Launching the execution from the API seems to be a pretty generic feature. Each client may have its own UI and want to decide at what moment execute the code. We want to produce this kind of tutorials but without launching all the code by default. We launch it if the bottom of the editor is visible.
Our code is working without problem. It's just that we had access to the view.execute()
function to launch the code. And if you change the structure of the editor, it will not work anymore.
from kotlin-playground.
Okay. I added a little patch eb985d
.
Try to use getInstance
function.
for example:
function getInstance(instance) {
instance.execute();
}
const eventFunctions = { getInstance: getInstance(instance)};
playground('.selector', eventFunctions)
from kotlin-playground.
Thank's a lot, it's working fine.
I have only one concern about the name of the function. getInstance
is not easy to understand because you are not calling getInstance
but instead giving a function that is going to be called to retrieve the executor. Maybe something like grabExecutor
, instanciatedExecutorCallback
... ? Executor is more precise than "instance" and also the API should emphasize the idea that, as a client of the API, you give a function to be notified of the instanciated executor.
from kotlin-playground.
🤔
If you print instance
parameter like
function getInstance(instance) {
console.log(instance)
}
You may see the current playground state and that state has the execute
method to run the code.
ps. I like grabExecutor
🙂
from kotlin-playground.
meet 1.15.0
from kotlin-playground.
Related Issues (20)
- [Bug] Online playground is not working when use `Executors.newSingleThreadExecutor().asCoroutineDispatcher()` as CorotuineDisaptcher
- no way to pass compiler options? HOT 1
- Full source for play.kotlinlang.org available? HOT 4
- JS IR compiler cannot find dependency HOT 1
- ability to use arguments that contain spaces HOT 1
- The code doesn't compile
- cannot create a `hashMap` from a `List<Pair<String, String>>` by using `hashMapOf` HOT 5
- Following a link to playground breaks browser back button
- Editor & console flickering
- remainder operator two is not zero student grades algorithm
- How to pass command line arguments dynamically HOT 1
- Code is automatically indented with spaces, but tabs are still inserted when I use the `Tab` key
- No main method found in project. HOT 1
- Adjustable height of console window for small size screens HOT 1
- tst
- How to change code from JS HOT 1
- Unexpected println output HOT 2
- Kotlin 2.0.0-Beta 2 on Kotlin Playground HOT 4
- String.substringAfter(String) behaves incorrectly
- [Feature Request] reset code to default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-playground.