Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Add example(s) and some documentation #1

Open
garyb opened this issue Jan 14, 2018 · 3 comments
Open

Add example(s) and some documentation #1

garyb opened this issue Jan 14, 2018 · 3 comments

Comments

@garyb
Copy link
Member

garyb commented Jan 14, 2018

No description provided.

@eviefp
Copy link

eviefp commented Jan 21, 2018

Does this look like anywhere near what you had in mind?

https://github.com/vladciobanu/purescript-halogen-proxy/blob/master/example/components-multitype/src/Container.purs

Would love some input and update the code. I'll write some documentation afterwards, maybe more examples.

@garyb
Copy link
Member Author

garyb commented Jan 21, 2018

That's a decent example of proxyTrans yep!

The one example I had in mind was for proxyQL / proxyQR, where there's a bunch of "pages" or something, and they have a Coproduct PageQuery <SomeInnerQuery> each, and then we disappear the <SomeInnerQuery> and just have them expose the PageQuery, so they can sit in the same top level container. I'd have to come up with something sensible-seeming that PageQuery should share amongst them first though. 😉

@eviefp
Copy link

eviefp commented Jan 22, 2018

Ah, that would be a more basic use case when you don't need the natural transform, right? The point being that all the pages share PageQuery, but each has its own SomeInnerQuery that is hidden?

I can't figure out a good example for Pages, but that would even work with the same components example with a bit of cleanup. I can refactor the record of maybe's to a sum type with a constructor for each component, then the common query would be GetState (SumType -> a) and the parent component would just store an array of states. Could even add a way to dynamically add more copies of component A/B/C.

I'll get back to you if I figure out a better example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants