Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
};
const removeShake = {
transform(state) {
return {
...state,
hikesApp: {
...state.hikesApp,
shake: false
}
};
}
};
return Observable
.just(removeShake)
.delay(500)
.startWith(startShake);
}
// move to next question
// index 0
if (tests[currentQuestion]) {
return Observable.just({
transform(state) {
const hikesApp = {
...state.hikesApp,
mouse: [0, 0]
};
return { ...state, hikesApp };
export default ({
DOM, // DOM driver source
globalEvents, // globalEvent driver sources
input$ = O.just({ // The text initial value of the input field
langId: "auto", // The selected language
term: "", // The value of the text field
}),
props$ = O.just({
showCompletion: true, // if buttons for inserting syntax tokens
// should be shown above the text field
}),
}) => {
const actions = intent({
DOM,
globalEvents,
});
const state$ = model(props$, input$, actions);
const vtree$ = view(state$);
it("executes the output signals by driver name and discards additional signals", done => {
const s = new Rx.Subject()
const check = expected => out$ => out$.subscribe(actual => {
actual.should.equal(expected)
s.onNext()
})
const [{compose}, _, E] = TSERS({
A: driver(check("a")),
B: driver(check("b")),
C: driver(undefined)
})
const out$ = compose({A: O.just("a"), B: O.just("b"), D: O.just("d")})
s.bufferWithCount(2).subscribe(() => done())
E(out$)
})
let main = () => ({
bot: $.from([
$.just(getUserProfilePhotos(
{ user_id: 39759851 },
{}))
])
})
let { sources, run } = Cycle(main, { bot: basicDriver })
function main() {
return mux({A: O.just("a"), B: O.just("b"), D: O.just("d")})
}
let main = () => ({
bot: $.from([
$.just(getFile(
{ file_id: FILE_ID },
{}))
])
})
let { sources, run } = Cycle(main, { bot: basicDriver })
export function fetch({ fetchContext = [] }) {
if (fetchContext.length === 0) {
log('empty fetch context found');
return Observable.just(fetchContext);
}
return Observable.from(fetchContext, null, null, Scheduler.default)
.doOnNext(({ name }) => log(`calling ${name} action creator`))
.map(({ action, actionArgs }) => action.apply(null, actionArgs))
.doOnNext(fetch$ => {
if (!Observable.isObservable(fetch$)) {
throw new Error(
'action creator should return an observable'
);
}
})
.map(fetch$ => fetch$.doOnNext(action => log('action', action.type)))
.mergeAll()
.doOnCompleted(() => log('all fetch observables completed'));
}
function searchByForModel(searchBy, modelTypeToSearch, valueToSearchFor, options = {}) {
if (!Boolean(modelTypeToSearch) || !Boolean(valueToSearchFor)) {
log.warn('forType property and value should be provided to be able to show results');
return Observable.just([]);
}
const searchQueryRequest = d2Lib.getInstance()
.then(d2 => d2.models[modelTypeToSearch])
.then(modelType => modelType.filter().on(searchBy).ilike(valueToSearchFor))
.then(modelTypeWithFilter => modelTypeWithFilter.list(options))
.then(collection => collection.toArray())
.catch(error => log.error(error));
return Observable.fromPromise(searchQueryRequest);
}
function main(sources) {
const {DOM, HTTP, router} = searchBar(sources);
const Content = ContentRouter(sources, Res);
//const {state$} = Content;
const searchBarDOM$ = DOM
const view$ = Observable.just(
view(
searchBarDOM$,
Content.DOM
)
);
return {
DOM: view$,
router: router.startWith('/'),
//state$: state$.startWith({counter: 0}),
HTTP: HTTP
}
};
.catch(() => Observable.just(''))
.shareReplay();