Skip to content

Commit

Permalink
fix: #76
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Apr 4, 2022
1 parent 2e933d4 commit ee78988
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit ee78988

Please sign in to comment.