8000 Arguments for "after" · Issue #17 · raganwald/method-combinators · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Arguments for "after" #17
Open
Open
@jeron-diovis

Description

@jeron-diovis

It is not enough to pass to after decorator only value, returned by decorated function. There can bee some logic, based on arguments of decorated function.

Of course, around can be used for this, but why should we care about manually calling origin fn?

Should be something like this:

this.after =
  (decoration) ->
    (base) ->
      (argv...) ->
        decoration.apply(this, [__value__ = base.apply(this, arguments)].concat(argv))
        __value__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0