@wilkerlucio @tony.kay It turns to work after I changed the name from 'login/login-complete to ‘fetch/items-loaded. Is the ‘login/login-complete a built-in-route? BTW: the cache is really an annoying problem. I’ve enable “Disable cache (while DevTools is open)”,hope it work.
@eric.shao the untangled template has a mutation named login/login-complete
, but not the framework, you can check the file https://github.com/untangled-web/untangled-template/blob/develop/src/client/untangled_template/ui/login.cljs#L18-L23
@wilkerlucio Thank you for your help! I am just using the untangled-template.😀
What are the components passed in to a module with the new untangled system for? Can I include dependencies for modules that way or does it have a different purpose?
@fatihict There are two things going on: One is composition of parsers, so an external library provider can "hook in" to your server Om API processing in a clean way. The other is the stuart-sierra style component injection, to make components available in your server and the env
of your parser
e.g. if one module returns nil from a mutation or read handler, then the next one in the chain is tried
Untangled is trying to make it possible to have libraries that can provide more than just raw UI. For example, the fact that we've defined the client-side Om Next mechanisms (mutate and read) enables things like the forms support in untangled-ui.
in raw Om Next, you cannot make assumptions about the database format, so supporting stateful form management would be a hard "plug-in" library to just make for the general public
So, we're trying to do similar things on the server: I want to use an image library tool (which we also have in untangled-ui)...how do the images get saved, retrieved, etc? How do I make UI components that have pre-built reads/mutations that allow easy re-use in a full-stack sense?
Om Next makes such things possible in general due to the abstract nature of reads/mutations...but a library provider would just have to document what those things are supposed to do...they would not really be able to provide implementations because there are too many unknowns about how you have implemented everything.
Did you use multimethods? What db are you using on the client? etc.
By making a few concrete decisions and providing implementations for them, we (I hope) open the door for a wider range of reusable libraries that provide more value.
@tony.kay Thanks for taking the time to explain it, that helps a lot 🙂. The more I learn about Untangled the more I appreciate it. I hope I'll get good enough soon to also contribute code to the project 😀
For the untangled.router (looking at devguide examples). Is there any way to set the active route on entry ? I’m probably missing something elementary.
So, each "router" is a component that can switch among the children
The "routing tree" is a concept/data structure that allows you to combine instructions to one or more "routers" for a given screen to appear from your overall app
The route-to
mutation triggers a routing tree instruction by name. The update-routing-links
is a function you can use to compose into your own mutations, for when you want to combine UI changes with other operations, such as data loading
"on entry"...I'm guess you mean according to URL loaded when page loaded? Yeah, in started-callback
on the client, just look at the URL and trigger a route-to
mutation.
@claudiu ^^^