reform icon indicating copy to clipboard operation
reform copied to clipboard

What happended to sync option for properties?

Open Azdaroth opened this issue 9 years ago • 7 comments

What happened to sync option that could be passed to properties for customizing syncing logic? I found it to be pretty useful in some case and with Reform 2.x it's gone now.

Azdaroth avatar Jul 22 '15 21:07 Azdaroth

I didn't add it to Disposable, yet. I found it too complicated, TBH, and didn't see its benefit compared to the complexity that got introduced.

Also, I never heard any feedback about it from any user so I wasn't sure if people use it.

Have you had a look at Imperative Callbacks in Disposable? They resemble what was the :sync option, e.g. they only get triggered when a property value has changed, and so on.

apotonick avatar Jul 23 '15 08:07 apotonick

I actually overriden sync method, which was more straightforward in my case. The biggest issue was updating to Reform 2.0.0 as it wasn't mentioned anywhere and found it quite surprising. But I think the feature itself was quite useful and provided nice way for customizing syncing logic, used in several forms.

Azdaroth avatar Jul 23 '15 13:07 Azdaroth

I never made the :sync public (did I???) that's why I thought I can sweep it under the carpet... :grimacing: Check out the imperative callbacks, they do exactly the same.

apotonick avatar Jul 23 '15 13:07 apotonick

Yeah, it was public, even documented. But still I find the semantics of the sync nicer, but if it's painful to maintain then I guess the issue can be closed.

Azdaroth avatar Jul 23 '15 19:07 Azdaroth

It's not that painful, we can re-add it to Disposable. Do you have any examples for me how you were using it?

apotonick avatar Jul 24 '15 11:07 apotonick

One example would be formatting credit card numbers, so when doing a sync it would keep only the last 4 digits and substitute the ones before with *.

Azdaroth avatar Jul 24 '15 11:07 Azdaroth

This is pretty much the same discussion we have here: #277

apotonick avatar Jul 25 '15 15:07 apotonick