Giter Site home page Giter Site logo

Comments (7)

AlexanderPrendota avatar AlexanderPrendota commented on May 28, 2024 1

also I added a little bit API spec 60282e.

What do you think about it?

from kotlin-playground.

AlexanderPrendota avatar AlexanderPrendota commented on May 28, 2024

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.

gzoritchak avatar gzoritchak commented on May 28, 2024

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.

AlexanderPrendota avatar AlexanderPrendota commented on May 28, 2024

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.

gzoritchak avatar gzoritchak commented on May 28, 2024

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.

AlexanderPrendota avatar AlexanderPrendota commented on May 28, 2024

🤔
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.

AlexanderPrendota avatar AlexanderPrendota commented on May 28, 2024

meet 1.15.0

from kotlin-playground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.