Git Product home page Git Product logo

Comments (4)

adamdbradley avatar adamdbradley commented on July 18, 2024 2

However, accessing dataLayer properties like functions, objects, etc... from the main thread is not intended. For example, DataLayer is an array filled by our functions inside the partytown's worker, but we can't access these data from the main thread. Some other third-party scripts depend on these data stored into datalayer, and these third parties work in another thread.

Would you be able to create simplified example of this? Maybe even just an index.html file with an inlined script?

from partytown.

oyilmaztekin avatar oyilmaztekin commented on July 18, 2024 1

Thanks for the reply. More accurately, I want to access some data of dataLayer from the main thread, created and filled inside partytown's worker. Actually, it is about creating communication between partytown's workers and the main thread. You already have messaging events. After every data change, partytown sends serialized data to the main thread. We can write our handler and catch these data, but I am searching for a more straightforward solution if possible, such as using forward prop, etc...

However, accessing dataLayer properties like functions, objects, etc... from the main thread is not intended. For example, DataLayer is an array filled by our functions inside the partytown's worker, but we can't access these data from the main thread. Some other third-party scripts depend on these data stored into datalayer, and these third parties work in another thread.

If you need an assist to clarify the situation, I can gladly help.

from partytown.

adamdbradley avatar adamdbradley commented on July 18, 2024

Thanks for the tip about dataLayer Inspector+, I'll start using that too.

Which dataLayer properties do you want to access from the main thread? If you can help me define what it needs to do we can work out some tests and update the code to make sure we can cover all the cases, or at least try. Thanks.

from partytown.

WebRom1145 avatar WebRom1145 commented on July 18, 2024

Is there already a solution for this? I have exactly the same problem.I want to update variables from the web worker in the main thread

from partytown.

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.