Skip to content

statelessComponent with displayName #156

Open
@anilanar

Description

@anilanar

As the title says. The implementation is simple:

exports.statelessComponent = function(displayName) { 
    return function(x) { 
        val y = function(props) { return x(props); };
        y.displayName = displayName;
        return y;
    };
};

Can name it statelessComponent' or something similar to avoid a breaking change.

Activity

natefaubion

natefaubion commented on Sep 25, 2018

@natefaubion
Contributor

You can already do this additional boxing with component. statelessComponent just coerces an existing function. It's just that PureScript has no semantics for adding a name to a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @natefaubion@anilanar

        Issue actions

          statelessComponent with displayName · Issue #156 · purescript-contrib/purescript-react