Skip to content

Instantly share code, notes, and snippets.

@jack-guy
Last active March 10, 2019 10:05
Show Gist options
  • Save jack-guy/f958b3f9c56ee42acb91d5692dbc3dd8 to your computer and use it in GitHub Desktop.
Save jack-guy/f958b3f9c56ee42acb91d5692dbc3dd8 to your computer and use it in GitHub Desktop.
from(iceCreamIds).pipe(
withLatestFrom(
iceCreamAuth$,
iceCreamPreferences$,
iceCreamVendors$,
iceCreamInventory$,
iceCreamTemperature$,
),
map(([
iceCreamId,
iceCreamAuth,
iceCreamPreferences,
iceCreamVendor,
iceCreamInventory,
iceCreamTemperature
]) => {
if (!iceCreamAuth) {
return [];
}
return [iceCreamId, iceCreamVendor, combineInfo(
iceCreamPreferences,
iceCreamInventory,
iceCreamTemperature
)];
}),
map(([iceCreamId, iceCreamVendor, combinedInfo]) => {
if (iceCreamVendor) {
return [iceCreamId, combinedInfo];
}
return [];
})
// ...
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment