hybridsjs / hybrids

Extraordinary JavaScript UI framework with unique declarative and functional architecture
https://hybrids.js.org
MIT License
3.06k stars 87 forks source link

Passing a transform function to 'reflect:' in a property descriptor has no effect without also specifying an observer #271

Closed nathawes closed 2 months ago

nathawes commented 2 months ago

For example, the two property descriptors below have the same value and reflect transform functions:

define({
    tag: 'issue-reproducer',
    reflected: {
        value: 'abc',
        reflect: value => value.toUpperCase()
    },
    reflectedAndObserved: {
        value: 'abc',
        reflect: value => value.toUpperCase(),
        observe: () => console.log('change observed')
    }
});

but their attribute values are reflected differently:

<issue-reproducer reflected="abc" reflected-and-observed="ABC"></issue-reproducer>

I think the call to reflect here might just need to be changed to fn.

smalluban commented 2 months ago

Thanks for the issue. I'll check it as soon as possible.

smalluban commented 2 months ago

Fixed in cce3efde417849af9cdda557f9595adeeda75a7b

Thanks!