red / REP

Red Enhancement Process
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

WISH: react/link to accept a single face #75

Open hiiamboris opened 4 years ago

hiiamboris commented 4 years ago

E.g. this is what I'm doing some times:

extend ...styles [
    my-style [
        template: [...]
        init: [
            react/link func [face _] [
                ...
            ] [face face]
        ]
    ]
]

init is evaluated from make-face with face bound to the make-faces (temporary) context, so I can't use react [... face/facet] there because face will be undefined by the time reaction gets evaluated. That's why I have to use react/link here, or do it's work of saving the objects myself.

I'd like to use simply react/link func [face] [...] face or react/link func [face] [...] [face] instead of react/link func [face _] [...] [face face].

hiiamboris commented 4 years ago

As a workaround this works for me:

    init: [
        context copy/deep [
            f: face
            react [.. f/facet]
        ]
    ]