RickWong/react-transmit

Support optional deferred props (and spinner components)

RickWong opened this issue · 2 comments

Apparently Relay now specifies a defer feature that allows some of the props to not be required but optional (on first render). This means that the way Transmit used to work a long time ago, was actually correct. Spinners and other while-loading components are simply declared within if-else blocks.

screen shot 2015-07-02 at 19 12 04

screen shot 2015-07-02 at 19 15 45

A Transmit implementation would either require adding a custom Promise.defer() method to the Promise definition to tell Transmit to defer resolving the query... or much simpler without screwing with Promise definitions: add a getQueryDeferred() method.

For the example from the screen captures above:

   CommentList.getQueryDeferred("comments")

Building a wrapper component to separate dependences as an alternative approach