Function Returns Union of Effects Instead of Merging Error and Success Channels
Any ideas why this function has a Union of effect and does not mice the error Chanel with the success?
The signature is
The signature is
typescript
const extractFieldsFromEmailAddress = (email: string) => {
const address = email.split("@")[0]
const fields = address.split(".")
if (fields.length !== 3) {
return Effect.fail(new Error())
}
const [model, model_item_id, token] = fields
return Effect.succeed({ model, model_item_id, token })
}typescript
const extractFieldsFromEmailAddress: (email: string) => Effect.Effect<never, Error, never> | Effect.Effect<{
model: string;
model_item_id: string;
token: string;
}, never, never>