viva.la
Radical Async Resolution. ✌️
No nonsense object resolver.
Viva la Resolution!
Install
npm i viva.la --save
Usage
Viva.la generates a function that will crawl an object and resolve any function values or promises into an object with identical keys.
Resolution
; { return ;} const myResolution = { return 'fight'; } { return 'the'; } { return 'power'; }; ;// 5 seconds later:// prints {viva: 'fight', la: 'the', resolution: 'power'}
Context
Using the resolver
top level composer, you can set a context that all methods have access to.
; const vivaLa = ; { return ;} const myResolution = { console; return 'fight'; } { console; return 'the'; } { console; return 'power'; }; ;// 1// 2// 3// then 5 seconds later:// prints {viva: 'fight', la: 'the', resolution: 'power'}
You can pass anything as context here.
const vivaLa = ; const myResolution = { ; return 'fight'; } { ; return 'the'; } { ; return 'power'; };; // Groovy// Groovy// Groovy
The default resolver implementation uses an empty object for context.
Method Arguments
Methods are called with the arguments context, {path, depth}
.
; const myResolution = viva: la: { console; console; return true; } ; ;// Depth 3// Path [ 'viva', 'la', 'resolution' ]// { viva: { la: { resolution: true } } }
Lifecycle
TODO
shouldResolve
TODO
onDidResolve
TODO
onWillResolve
TODO
License
MIT