Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performRouteHandlerStaticMethod doesn't work with decorators #14

Open
vjpr opened this issue May 19, 2015 · 1 comment
Open

performRouteHandlerStaticMethod doesn't work with decorators #14

vjpr opened this issue May 19, 2015 · 1 comment

Comments

@vjpr
Copy link

vjpr commented May 19, 2015

await performRouteHandlerStaticMethod(state.routes, 'routerWillRun', routeHandlerInfo)

export default async function performRouteHandlerStaticMethod(routes, methodName, ...args) {
  return Promise.all(routes
    .map(route => {route.handler[methodName]; console.log(route, route.handler)})
    .filter(method => typeof method === 'function')
    .map(method => method(...args))
  );
}

This doesn't work when you use decorators around your components. E.g. I wrapped my components when using react-dnd and route.handler is the DragAndDropContainer.

Is their a better approach?

@merk
Copy link

merk commented May 20, 2015

acdlite/flummox#168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants