Skip to content

feat: create "transformation pipelines' #34

@brent-hoover

Description

@brent-hoover

One of the cool features that Reaction had that I believe @aldeed came up with is the way that you could use functionsOfType to define a "pipeline" of functions that, for example, a cart might flow through on placeOrder so any plugin could insert itself into that to apply a discount for example.

I think we should reimplement it but possibly make it more explicit. Some ideas might be:

  • Create a separate 'pipeline' object separate from functions of type where you could declare a named pipeline and then have methods on that.
  • Allow functions to insert themselves as more explicit places like "last" or "first"
  • Allow plugins to remove another entry in the pipeline or replace an existing one
  • Use decorators to be able to add a pipeline to a method
  • Allow a function to cleanly abort a pipeline and have the calling method catch the error
  • ???

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions