Skip to content

Placeholder name, eg %name #274

@pie6k

Description

@pie6k

I wanted to propose adding an optional placeholder name to the syntax and ask you what do you think about it?

Example:

const fileName = "file.txt";

fileName
  |> addServerPath(%) // `/path/to/server/file.txt`
  |> convertToUrl(%filePath) // `http://server.com/path/to/file.txt`
  |> await fetchFile(%fileUrl) // some node file object
  |> await saveFile(%fileHandler, "downloads")

As seen, in the pipe steps we add the name of the placeholder. It is optional and has 0 impact on how this code works, but makes it easier to read, as we can add the information 'what is the placeholder at this step' so the reader of the code doesn't have to guess it from function names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-on proposalDiscussion about a future follow-on proposal

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions