Skip to content

asks

asks<R, A>(f): Reader<R, A>

Defined in: Core/Reader.ts:64

Projects a value from the environment using a selector function. Equivalent to pipe(Reader.ask(), Reader.map(f)) but more direct.

R

A

(env) => A

Reader<R, A>

const getBaseUrl: Reader<Config, string> = Reader.asks(c => c.baseUrl);
getBaseUrl(appConfig); // "https://api.example.com"