Skip to content

Commit c2f1588

Browse files
committed
feat: Add support for deletable fields
1 parent 0af3950 commit c2f1588

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

packages/effect-firebase/src/lib/firestore/model/optional.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Schema } from 'effect';
22
import { VariantSchema } from '@effect/experimental';
33
import { VariantsDatabase, fieldEvolve } from './core.js';
4-
import { Delete } from '../schema/delete.js';
4+
import { Delete } from '../schema/fields.js';
55

66
/**
77
* Convert a field to one that is optional for all variants.

packages/effect-firebase/src/lib/firestore/schema/delete.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Schema } from 'effect';
2+
3+
/**
4+
* Represents a delete operation. This will remove the field from the document.
5+
*/
6+
export class Delete extends Schema.Class<Delete>('Delete')({}) {}
7+
export const DeleteInstance = Schema.instanceOf(Delete);
8+
9+
export class ArrayAdd extends Schema.Class<ArrayAdd>('ArrayAdd')({}) {}
10+
export const ArrayAddInstance = Schema.instanceOf(ArrayAdd);
11+
12+
export class ArrayRemove extends Schema.Class<ArrayRemove>('ArrayRemove')({}) {}
13+
export const ArrayRemoveInstance = Schema.instanceOf(ArrayRemove);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './timestamp.js';
22
export * from './geopoint.js';
33
export * from './reference.js';
4-
export * from './delete.js';
4+
export * from './fields.js';

0 commit comments

Comments
 (0)