Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default R.curry((services, actions$, state$) =>
state$.sampledBy(actions$.thru(ofType(READ_RC_FILE))).take(1)
.filter(action => isTestCommand(action) || isDevCommand(action))
.flatMap(state => {
switch (getCommandType(state)) {
case 'unit':
case 'tdd':
return unitTestRunner(services, actions$, state$);
default:
// @todo emit error
return Kefir.never();
}
})
);
export default function searchDelta(actions$: Observable, state$: Observable): Observable {
return state$.sampledBy(actions$.thru(ofType(searchInput)))
.filter((state: TinyMCEState) => state.search.term)
.flatMapLatest((state: TinyMCEState): Observable => ajax$(getSearchUrl(state), {
method: 'GET',
headers: {
'X-WP-Nonce': state.globals.nonce
}
}))
.flatMap((response: ObsResponse) => response.json())
.map(searchResultsSucceeded);
}
export const takeStateOnBootstrap = (state$, actions$) =>
state$.sampledBy(
actions$.thru(ofType(READ_RC_FILE, READ_ENV, RUN))
.bufferWithCount(3)
).take(1);
return state$.take(1).flatMap(state => {
switch (R.view(lCommandTypeArg, state)) {
case 'app':
return actions$.thru(ofType(WEBPACK_COMPILED)).flatMap(({ payload }) =>
ui.log('info', payload.stats.toString({ colors: true }))
);
case 'tdd':
default:
return Kefir.never();
}
});
};
preplug={a$ =>
a$
.thru(ofType(wpActions.change))
.map(action => createFilenameChange(action.payload.value))
}
(state): Observable => {
const ret = toObs(state.e2e.startup?.())
.map(msg => actions.startup.success({ msg }))
.flatMapErrors(err => Kefir.constant(actions.startup.failure(err)));
return state.e2e.shutdown == null
? ret.takeUntilBy(action$.thru(ofType(actions.shutdown.request)))
: ret;
}
)