Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #76 #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/core/src/types/modifyReadResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { DocMetadata } from './atoms'
/**
* Can be used to modify docs that come in from 'stream' or 'fetch' actions, before they are added to your store data. When returning `undefined` they will be discarded & won't be added to the store data.
*/
export type OnAddedFn = (docData: Record<string, any> | undefined, docMetadata: DocMetadata) => Record<string, any> | void //prettier-ignore
export type OnAddedFn = (docData: Record<string, any>, docMetadata: DocMetadata) => Record<string, any> | undefined //prettier-ignore

/**
* Is triggered only while a 'stream' is open, and can modify docs that were modified on another client, before they are updated to the store data. When returning `undefined` they will be discarded & the modifications won't be applied to the store data.
*/
export type OnModifiedFn = (docData: Record<string, any> | undefined, docMetadata: DocMetadata) => Record<string, any> | void //prettier-ignore
export type OnModifiedFn = (docData: Record<string, any>, docMetadata: DocMetadata) => Record<string, any> | undefined //prettier-ignore

/**
* Is triggered only while a 'stream' is open, every time a document is either 'deleted' on another client OR if a document doesn't adhere to the clauses of that 'stream' anymore. When returning `undefined` they will not be removed from the store data.
*/
export type OnRemovedFn = (docData: Record<string, any> | string | undefined, docMetadata: DocMetadata) => Record<string, any> | string | void //prettier-ignore
export type OnRemovedFn = (docData: Record<string, any> | string, docMetadata: DocMetadata) => Record<string, any> | string | undefined //prettier-ignore

/**
* These functions will be executed everytime BEFORE documents are added/modified/deleted in your local data store. The function defined will receive the payload with changes from the server. You can then modify and return this payload.
Expand Down