Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open source projects built with sanctuaryjs #573

Open
andrei-cacio opened this issue Jul 12, 2018 · 8 comments
Open

Open source projects built with sanctuaryjs #573

andrei-cacio opened this issue Jul 12, 2018 · 8 comments

Comments

@andrei-cacio
Copy link

Hi there, I am looking for some more complex examples of near real-world projects/anything built with sanctuary. Can someone point me to some nice repos?

Kind thanks and big kudos up for this wonderful library!

@davidchambers
Copy link
Member

I have been pointing people to generate, the script used to generate the Sanctuary website from the project's documentation, but I imagine you're hoping to see some asynchronous computations. I don't have a suitable project to share, but I invite the community to pitch in. I believe @Avaq and @dakom may be able to help here.

Kind thanks and big kudos up for this wonderful library!

Thank you for the kind words. 😊

@dakom
Copy link

dakom commented Jul 15, 2018

I'm humbled to be in the same sentence as @Avaq since pretty much all the JS/TS async stuff I'm doing is just passing around Flutures :)

Wish I could share it as example but my dayjob project is closed source... one thing I'll say is that the semantics of Sanctuary and Fluture just outright prevent entire classes of bugs that are super easy to accidentally create otherwise, and it's really a pleasure knowing that I'm building on a solid foundation.

One open source thing that I have which might be worth a peek is this little thing I released a few weeks ago: https://github.com/dakom/ball-bounce-frp

Gotta give it time to load since there's a bunch of heavy graphics. Almost the entire logic is in this file: https://github.com/dakom/ball-bounce-frp/blob/master/src/app/worker/frp/Ball-FRP.ts

As you can see it makes very heavy use of Sanctuary's Maybe and map :) Without that, there would be much more noise like if(bounceHasStarted) or if(bounceHasFinished) etc. The FRP lib I used also has the fantasy-land stuff added to it so there's a lot of power lurking under the hood (though just a heads up - the FRP lib I used does have an outstanding bug... and I don't want to derail the conversation here into that).

Though honestly I think we're kindof just seeing the beginning of a new revolution and the real mind-blowing stuff is still around the corner. It's only a matter of time before people really start looking at how to write functional JS to stay sane while scope of web apps blows up, especially with the growing popularity of frameworks like React that heavily lean on some of the same principles.

@andrei-cacio
Copy link
Author

I would love to see a React app written with SanctuaryJS :)

Also thank for the examples, it is a great start !

@andrei-cacio
Copy link
Author

If you don't mind, I would like to keep the issue open, maybe others will chip with examples.

@dakom
Copy link

dakom commented Jul 17, 2018

Here's a minimal example using Sanctuary with React: https://codesandbox.io/s/8kwpv0r3w9

It may not seem all that big of a difference from just setting state to some object with "isError" or whatever keys, but the thing is - with this "railway oriented programming" you can have large or async pipelines that "exit early" via combinations of map/chain and Either/Maybe. So for example you can have a Fluture that you fold() into an Either - or even a whole series of them, and if at any point in that mechanism you get an error or stop the loading, it will literally use the same exact code as this tiny demo, in terms of updating the view accordingly :)

@davidchambers
Copy link
Member

https://github.com/sanctuary-js/sanctuary/network/dependents may be helpful.

@bionicles
Copy link

How do you feel Sanctuary could improve Context + Resolvers in an Apollo Server GraphQL for RedisGraph? I'm super keen to get into graph data with this stack and want to do this... but this library is so jargon-heavy I'm concerned it's gonna slow me down rather than help, and that it would scare off other implementers

@davidchambers
Copy link
Member

How do you feel Sanctuary could improve Context + Resolvers in an Apollo Server GraphQL for RedisGraph?

I know very little about these things, @bionicles. Perhaps someone else will be more helpful. 🤞

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

No branches or pull requests

4 participants