There’s actually an issue in the repo about this and I’m now working on it.
James Gillmore
1

Why not? If it’s necessary. But current structure is very handy to use. I think here is a better solution to define action creation function which will hide action structure. It should works like this:

const gotoUsers = createrAction(
'USERS', '/users/:status', {query: true}
);
gotoUsers('active', {page: 2});

So gotoUsers returns an action object:

{
action: 'USERS',
payload: {
params: {
status: 'active'
},
query: {
page: 2
}
}
}

Action creation function should parse route and extract params. The last argument is always a query object.

If you’re thinking about back compatibility, then this can help you to avoid a lot of troubles in the future.

Show your support

Clapping shows how much you appreciated Pasha Rumkin’s story.