prodo-dev / prodo

Prodo is a React framework to build apps faster.
https://docs.prodo.dev
MIT License
114 stars 5 forks source link

Route plugin: Cannot access path in action #189

Open coffee-cup opened 4 years ago

coffee-cup commented 4 years ago

In an action, route is a universe watcher. This means that to access any value on it (such as path), I need to watch. e.g.

const myAction = () => {
  const url = watch(route.path);
}

It does not make sense to watch values in actions. I should be able to get the path without watching.