How can I meet all of these requirements?
- eliminate the extra level of nesting
- eliminate the required constructor params node0 and node1
- use valid Javascript
- prioritize ease of use (no custom hashing function)
BAD
let interactions = {
node0: {
node1: {
physics: new PhysicsReducer(node0, node1, config);
}
}
};
GOOD
let interactions = {
[node0, node1]: {
physics: new PhysicsReducer(config)
}
};
Thanks
Aucun commentaire:
Enregistrer un commentaire