Giter Club home page Giter Club logo

reagent-bidi-accountant-example's Introduction

Example project: Reagent client side routing with Bidi, Accountant and Clerk

A simple example trying to demonstrate a way to do client side routing with Bidi, Accountant and Clerk in Reagent projects.

There is a live demo of a very similar project here: clerk-demo.netlify.com.

I talk considerably more about this example in this blog post. (Except the Clerk part, which is a later addition.)

Setup

I have also configured the project to support an interactive development workflow. To start the example run:

$ lein repl

wait for the routing-example.user name space to load and then issue:

routing-example.user> (start)

Open your browser at localhost:4449. You will have Figwheel’s magic enabled.

If you are using Emacs you can start the repl using cider-jack-in and enjoy a CIDER enabled development workflow. (This is extra handy for when you are learning how to set up Bidi routing tables.)

If you use VS Code I recommend installing Calva, which will bring you some of the Emacs Cider experience. (Yes, I am biased, I am the publisher of Calva.)

License

Use however you want, at your own risk.

reagent-bidi-accountant-example's People

Contributors

pez avatar

Stargazers

Hoang Van Nhat avatar Terje Sten Bjerkseth avatar Girish Sonawane avatar Andreas Kröhnke avatar Józef Piątkiewicz avatar  avatar Stathis Sideris avatar Lucas Leblow avatar Aleksandr Zhuravlёv avatar Alexander Zinolidis avatar Raichev Dmitry avatar Satoshi Kurokawa avatar Yuri Khmelvsky avatar Sergey Tkachenko avatar Christofer Roth avatar No Say avatar Ikuru K avatar Artem Espolov avatar Alex Khrustalev avatar Adam Moore avatar  avatar Paul Gowder avatar Josh Miller avatar

Watchers

 avatar Linus Ericsson avatar James Cloos avatar  avatar

Forkers

wilsonch

reagent-bidi-accountant-example's Issues

doesn't work when components are returned as functions

Hi really liked your example.

It works fine for me when I have a component like this

(defmethod page-contents :foo [] [:a {:href (bidi/path-for routes :bar)} "link"])

but not when I have the same but returning a function

(defmethod page-contents :foo [] (fn [] [:a {:href (bidi/path-for routes :bar)} "link"]))

I can see that bidi/accountant are working and the session is updated as expected, but the page fn doesn't 'notice' that the route has changed and the component is not rendered.

Any thoughts on what the difference is?

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.