Skip to content

Reagent/fe-frame examples break the reload-on-save #713

@farcaller

Description

@farcaller

(via slack)

The re-frame example stores the route inside re-frame's db. The reagent example stores the same in an ratom. This creates a problem, where, given the routes structure, you will store the whole route including the actual view function (e.g.). In turn, this creates a problem if you reload this function in the repl, because its actually referred from the state, meaning the wrong version of the function will be executed 9and it might further corrupt the state).

One option would be to store the Var in the route (e.g. #'home-page for the example above) and then deref it in the route render function, but it was advised against too in the slack.

What'd be the most safe way to store the route in the state management so that it doesn't refer to anything but the route data itself? I don't mind sending a follow up PR to fix the examples, too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions