Zum Inhalt springen

Effect

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

If you have not heard about it before, Effect^ is a powerful TypeScript library designed to help developers easily create complex, synchronous, and asynchronous programs.

StudioCMS utilizes Effect to manage most of our code, bringing simplicity and easier reuse of functions. It has also helped us optimize dashboard loading times by taking an entirely new approach to async code.

While working with StudioCMS and Effect, instead of needing to install it yourself, StudioCMS provides the Effect tools via the following export

example.ts
import { Effect, Context, Schema, Data } from 'studiocms/effect';

This includes all the same base exports from Effect’s default export import {} from 'effect'; as well as some other useful utilities from effect/Function and custom ones from StudioCMS.

custom-utils.ts
import { runEffect, genLogger, pipeLogger, runtimeLogger } from 'studiocms/effect';
Want to learn more about Effect? Check out the Effect documentation^