Coder Social home page Coder Social logo

react-webworker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-webworker's Issues

Support for reference post message.

Perhaps I confused but can we get a method to post to the worker in a function?

I used a reference in react on the object and tried the follow but it did not work:
refWorker.postMessage

How can I get access to that worker from functions in the page?

Can I have an example with create-react-app?

Can I have an example with create-react-app?

I've tried to implement this lib within create-react-app project but it does not work.
It seems my worker.js has something wrong.

image

component.js

 <WebWorker url="/worker.js">
    {({ data, error, postMessage }) => {
      if (error) return `Something went wrong: ${error.message}`
      if (data)
        return (
          <div>
            <strong>Received some data:</strong>
            <pre>{JSON.stringify(data, null, 2)}</pre>
          </div>
        )
      return <button onClick={() => postMessage('hello')}>Hello</button>
    }}
  </WebWorker>

https://codesandbox.io/s/ox85ooo31q

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • babel-cli 6.26.0
  • babel-preset-env 1.7.0
  • babel-preset-flow 6.23.0
  • babel-preset-react 6.24.1
  • babel-preset-stage-2 6.24.1
  • jest 23.5.0
  • jest-dom 1.12.0
  • react 16.4.2
  • react-dom 16.4.2
  • react-testing-library 5.0.0
  • react >=16.3.0
travis
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Can give an example for use this npm ,

<WebWorker url={getOneUrl(/repositories/${repoId}/merge_requests/${mrIid}`)}>

    {diffData.changes.map((v) => (
      <Card
        id={v.id}
        diff={v.diff}
        source={v.source}
        viewType={viewType}
        diffComment={filterCommentById(v.id)}
        name={v.newPath || v.oldPath}
        newPath={v.newPath}
        oldPath={v.oldPath}
        renamedFile={v.renamedFile}
        addLinesCount={v.addLinesCount}
        deleteLinesCount={v.deleteLinesCount}
      />
    ))}

  </WebWorker>`

get error
image

Support custom Worker instance

Parcel is able to automatically create a JS bundle when it sees new Worker('path'). I'm order to support this, react-webworker must allow the user to pass such Worker instance to <Worker> instead of having it create its own internal instance based on the provided url.

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.