MCPcopy Create free account
hub / github.com/Snapchat/Valdi / onApply

Method onApply

valdi/src/valdi/runtime/Views/ViewAttributeHandlerDelegate.cpp:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace Valdi {
14
15Result<Void> ViewAttributeHandlerDelegate::onApply(ViewTransactionScope& viewTransactionScope,
16 ViewNode& viewNode,
17 const Ref<View>& view,
18 const StringBox& name,
19 const Value& value,
20 const Ref<Animator>& animator) {
21 viewTransactionScope.transaction().executeInTransactionThread(
22 [view, animator, self = strongSmallRef(this), viewNode = strongSmallRef(&viewNode), value, name]() {
23 auto result = self->onViewApply(view, name, value, animator);
24 if (!result) {
25 viewNode->notifyAttributeFailed(viewNode->getAttributeIds().getIdForName(name), result.error());
26 }
27 });
28
29 return Void();
30}
31
32void ViewAttributeHandlerDelegate::onReset(ViewTransactionScope& viewTransactionScope,
33 ViewNode& viewNode,

Callers

nothing calls this directly

Calls 7

strongSmallRefFunction · 0.85
notifyAttributeFailedMethod · 0.80
getIdForNameMethod · 0.80
errorMethod · 0.65
VoidClass · 0.50
onViewApplyMethod · 0.45

Tested by

no test coverage detected