reform
reform copied to clipboard
What happended to sync option for properties?
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.
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.
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.
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.
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.
It's not that painful, we can re-add it to Disposable. Do you have any examples for me how you were using it?
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 *
.
This is pretty much the same discussion we have here: #277