Skip to content

Is it possible to derive a binding using a key-path? #3196

Answered by mbrandonw
wltrup asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @wltrup, the syntax $store.property1 is unlocked by @dynamicMemberLook, and technically desugars to:

$store[dynamicMember: \.property1]

So you should be able to do:

$store[dynamicMember: propertyKeyPath].sending(actionCasePath)

Can you let me know if that works?

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@larryonoff
Comment options

@mbrandonw
Comment options

@larryonoff
Comment options

@mbrandonw
Comment options

@wltrup
Comment options

Answer selected by wltrup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants