Open cloud-walker opened 7 years ago
but it seems ugly to me as you need to create a class
I've never written a class inside of a Cycle.js application, nor have I seen one :)
The PascalCase
is a conventionin the Cycle.js community to distinguish components from other functions.
I don't see any particular reason why a Link component couldn't be create, it just hasn't been yet.
I mean css class like them:
I really have to invent a class to bind every anchor of my application? Or I'm missing something? I'm pretty new here as you may have noticed :sweat_smile:
You could just listen to anchor tags.
DOM.select('a').events('click')
To be able to toggle the "active" state of the link, I feel like a feature is missing on RouterSource for this to be possible: the possibility to know whether the current location matches a path (or the current namespace + path part). Or is there something I missed?
I'm wondering if with cyclejs is possible to craft a generic Link component that accept the route from the props, and manage the click event handler internally.
I saw the dynamic change route section on the readme, but it seems ugly to me as you need to create a class for each link, and map them all on the router: xs.merge ... thing.