react-transmit icon indicating copy to clipboard operation
react-transmit copied to clipboard

How does writing fit in?

Open Syynth opened this issue 10 years ago • 3 comments

Do you currently have a way to handle writes and updates? Say for instance I want to implement a post box to go along with the news feed example, how could I build that in such a way that the news feed would at least know to re-run it's query?

Syynth avatar May 05 '15 20:05 Syynth

Thanks! You've brought up a good point. I haven't looked into how Relay and GraphQL do it officially, but this React issue touches the subject: https://github.com/facebook/react/issues/3398

Sideways data loading (as in data that isn't passed-in as props) is something normally done by binding a component's this.setState to a data store's change event. That basically makes the React component react/observe/listen to newly inserted or otherwise updated data. I haven't brought this concept into Transmit, yet... If the observe API in the above linked React issue makes it into React core, then I'll definitely see if I can use that.

RickWong avatar May 05 '15 22:05 RickWong

There seem to be a lot of questions regarding this (#4, #13).

It doesn't look like the observable support is going to get into react core so soon, and if it does, I'm not sure if it would mix well with react-transmit being a HOC. I would love to see support for observables in react-transmit itself.

miracle2k avatar Jun 01 '15 15:06 miracle2k

@miracle2k You're right. We shouldn't wait for React observe() as it's currently being reconsidered.

Checkout issue #25 where I posted a small update.

RickWong avatar Jun 01 '15 22:06 RickWong