Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sources[localChannel].stream.startWith(undefined)
)
.map(([g, l]) => merger.merge(g, l))
.remember()
const sinks = cmp({
...omit([localChannel])(sources),
[stateChannel]: new StateSource(
state$.drop(2),
'withLocalState'
)
})
// Convert the emitted reducers back to state values and run
// it through extract
const updated$ = !sinks[stateChannel] ? xs.never() :
sinks[stateChannel]
.compose(sampleCombine(state$))
.map(([reducer, state]) => merger.extract(reducer(state)))
// Convert the extracted state values back to reducers for the separate
// channels
const global$ = updated$.map(extractedState => prevState => {
return { ...prevState, ...extractedState.global }
})
const local$ = updated$.map(extractedState => prevState => {
return { ...prevState, ...extractedState.local }
})
return {
...sinks,
_n(inst: InternalInstances): void {
this.inst = inst;
const arrSinks = inst.arr;
const ils = this.ils;
const out = this.out;
const sel = this.sel;
const n = arrSinks.length;
// add
for (let i = 0; i < n; ++i) {
const sinks = arrSinks[i];
const key = sinks._key as any as string;
const sink: Stream = xs.fromObservable(sinks[sel] || xs.never());
if (!ils.has(key)) {
ils.set(key, new PickMergeListener(out, this, sink));
sink._add(ils.get(key) as PickMergeListener);
}
}
// remove
ils.forEach((il, key) => {
if (!inst.dict.has(key) || !inst.dict.get(key)) {
il.ins._remove(il);
il.ins = null as any;
il.out = null as any;
ils.delete(key);
}
});
}
const xsComponentSinks: Sinks = Object.keys(
componentSinks
)
.map(k => ({
[k]: xs.fromObservable(componentSinks[k])
}))
.reduce(
(prev, curr) => Object.assign(prev, curr),
{}
);
return [
...acc,
{
...xsComponentSinks,
modal: xs.merge(
xsComponentSinks.modal || xs.never(),
overlayClose$
)
}
];
}
return acc;
}, []);
h(Text, { style: styles.installText }, "Install"),
]),
],
),
h(ScrollView, { style: styles.readmeContainer }, [
h(Markdown, { styles: mdStyles, rules }, state.app.readme),
h(View, { style: styles.readmeFooter }),
]),
]),
}));
return {
screen: vdom$,
navCommand: xs.never(),
onion: xs.never(),
http: xs.never(),
installApk: installApk$,
};
}
state: topBarLens,
})(sources);
const state$ = sources.state.stream;
const actions = intent(sources.navigation, sources.screen, topBarSinks.back);
const confirmation$ = dialog(actions, state$, sources.ssb, sources.dialog);
const dismissKeyboard$ = actions.goBack$.mapTo('dismiss' as 'dismiss');
const vdom$ = view(state$, topBarSinks.screen);
const command$ = navigation(state$, actions, confirmation$);
const reducer$ = model(sources.props, actions);
return {
keyboard: dismissKeyboard$,
screen: vdom$,
navigation: command$,
toast: xs.never(),
state: reducer$,
};
}
h(View, { style: styles.installContainer }, [
h(Text, { style: styles.installText }, "Install"),
]),
],
),
h(ScrollView, { style: styles.readmeContainer }, [
h(Markdown, { styles: mdStyles, rules }, state.app.readme),
h(View, { style: styles.readmeFooter }),
]),
]),
}));
return {
screen: vdom$,
navCommand: xs.never(),
onion: xs.never(),
http: xs.never(),
installApk: installApk$,
};
}
...driverNames.map(n => ({ [n]: xs.never() })).reduce(Object.assign, {}),
...main(sources)
function dropCompletion(input: Stream): Stream {
return xs.merge(input, xs.never());
}
.map(isTabVisible =>
isTabVisible
? concat(xs.of(0), xs.periodic(2000).take(2), xs.periodic(6000))
: xs.never(),
)
export default function tutorialPresentation(
sel: string | symbol,
props: Props | null,
children: Array,
) {
return h(View, {style: styles.container}, [
h(
Swiper,
{
sel,
showsButtons: false,
horizontal: true,
loop: false,
scrollBy$: props?.scrollBy$ ?? xs.never(),
activeDotColor: Palette.colors.white,
automaticallyAdjustContentInsets: true,
},
children,
),
]);
}