Skip to content
This repository was archived by the owner on Jul 30, 2018. It is now read-only.
This repository was archived by the owner on Jul 30, 2018. It is now read-only.

Should be able to define an Outlet component for multiple outlet names #103

@agubler

Description

@agubler

Enhancement

In certain scenarios it is helpful to be able to define a single Outlet that will render for multiple (or all outlets) and just inject params when from url when they exists.

Currently usage restricts the mapping of a an Outlet component to a single outlet from the routing configuration.

// example routing config
const routingConfig = [
    {
        path: '/foo',
        outlet: 'foo'
    }
];
const myOutlet = Outlet(MyWidget, 'foo');

But there are use-case where being able to create an outlet component that maps to multiple outlets within the routing config would be helpful, this could be done by accepting an array string[] as well as a single string. This will probably need a change to the Router#getOutlet function to accept the same types and when it's an array return the matching outlet if there is one.

// example routing config
const routingConfig = [
    {
        path: '/foo',
        outlet: 'foo'
    }
    {
        path: '/bar',
        outlet: 'bar'
    }
    {
        path: '/baz',
        outlet: 'baz'
    }
];
const myOutlet = Outlet(MyWidget, [ 'foo', 'bar', 'baz' ]);

Would need to think about what to do if more than one of the specified outlets match? And if that's even a scenario that should be supported.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions