Nested Update/Effects
See original GitHub issueHave you considered this:
app({
update: {
example: {
attempt: () => alert(1)
}
}
})
It should then be possible to call msg.example.attempt()
.
Meanwhile I ended up using this
const convert = (actions, prefix = '') => Object
.keys(actions)
.map(name => typeof actions[name] === 'function'
? ({[`${prefix[0].toLowerCase()}${prefix.slice(1)}${name[0].toUpperCase()}${name.slice(1)}`]: actions[name]})
: (convert(actions[name], `${prefix}${name[0].toUpperCase()}${name.slice(1)}`))
)
.reduce((a, b) => Object.assign(a, b), {})
app({
update: convert({
example: {
attempt: () => alert(1)
}
})
})
This maps example.attempt
to exampleAttempt
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
java.awt.IllegalComponentStateException when nested ...
If I pass state = WindowState(width = 1000.dp, height = 1000.dp) into a Window I get the following exception when it's recomposed: Exception ......
Read more >View.UpdateEffect
Construct the effect that is returned by the command handler. The effect describes next processing actions, such as emitting events and sending a...
Read more >Visualizing Nested and Cross Random Effects - Josh Errickson
Whether random effects are nested or crossed is a property of the data, not the model. However, when fitting the model, effects can...
Read more >BeaconMenu (forge 1.18.2-40.1.51)
Nested Class Summary. Nested Classes. Modifier and Type. Class. Description ... stillValid(Player p_39047_). void. updateEffects(int p_39054_, int p_39055_) ...
Read more >Logistic-Tropical Decompositions and Nested Subgraphs
to nested subgraphs, i.e. graphs whose adjacency matrix is nested. ... e function UpdateFactors (Line 8) follows the SGD approach.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@selfup This is possible though:
Now there is no naming conflict but it is no longer flat 🤔