yahoo / fluxible

A pluggable container for universal flux applications.

Home Page:http://fluxible.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should dispatch NAVIGATE_FAILURE if action is not able to resolve

lingyan opened this issue · comments

if (!action || 'function' !== typeof action) {
debug('route has no action, dispatching without calling action');
context.dispatch('NAVIGATE_SUCCESS', completionPayload);
done();
return;
}

There are two cases here:

  • action is not specified (route.action is empty): Fine to dispatch NAVIGATE_SUCCESS
  • action is specified but unable to resolve into a function: SHOULD dispatch NAVIGATE_FAILURE

We should fix the second case to dispatch failure event. Dispatching success event masks the problem and makes debugging hard.

This was fixed in both fluxible-router 1.x. and 2.x major versions.

Yeah! thanks @redonkulus 🥇