Otherwise method?

30 views
Skip to first unread message

j0n b0n

unread,
Jun 27, 2017, 4:21:49 PM6/27/17
to Limonade
Hey!

I really love your framework and thought it would be awesome to have a function wich is executed if the routing path was not found.
In AngularJS this function is called 'otherwise()', maybe something like that?

F.e. 
If you have a dispatch-function for '/getUsers' and '/getUser/:id' but somebody calls '?u=/some_page', Limonade would execute that 'otherwise()' function and this function redirects to the homepage or throws an error.

I would like to hear your ideas about this!

Thanks, 
 Skayo

P.S.: I'm sorry if this idea exists

j0n b0n

unread,
Jun 28, 2017, 12:46:04 PM6/28/17
to Limonade
Nevermind. You can have the same functionality by using
dispatch('/*', 'otherwise_function')
as the last dispatch.

Fabrice Luraine

unread,
Jul 12, 2017, 10:05:30 AM7/12/17
to Limonade
Hello !

Or you can use error handling functions to catch your 404 : https://github.com/sofadesign/limonade#error-handling
Reply all
Reply to author
Forward
0 new messages