0.1.0 • Published 1 month ago

@invertase/firebase-extension-utilities v0.1.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 month ago

firebase-extension-utilites

firestore-onwrite-processor

This provides a processor class which you can pass to your firestore onWrite call, and will handle the state of processes on firestore fields for you.

import {
  FirestoreOnWriteProcessor,
  FirestoreOnWriteProcess,
} from "@invertase/firebase-extension-utilities";

// this can be async if needed
const processFn = ({ input }) => {
  // do stuff here
  return { output };
};

const myProcess = new FirestoreOnWriteProcess(processFn, {
  id: "myProcessId",
  fieldDependencyArray: ["input"],
});

const myProcessor = new FirestoreOnWriteProcessor({
  processes: [myProcess],
});

export const myFunction = functions.firestore
  .document(COLLECTION_NAME / { id })
  .onWrite(myProcessor.run);
0.1.0

1 month ago

0.0.9

1 month ago

0.0.8

2 months ago

0.0.5

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

3 months ago