feat: support filtered subscriptions
This commit is contained in:
@@ -28,8 +28,11 @@ class BaseError extends Error {
|
||||
}
|
||||
|
||||
const createApi = async (runtime: StashRuntime = new StashRuntime()) => {
|
||||
runtime.documents.on('upserted', (document) => {
|
||||
console.log(document);
|
||||
runtime.documents.subscribe({
|
||||
filter: "metadata.foo = 'bar'",
|
||||
fn: (document) => {
|
||||
console.log(document);
|
||||
},
|
||||
});
|
||||
const app = fastify().withTypeProvider<ZodTypeProvider>();
|
||||
app.setValidatorCompiler(validatorCompiler);
|
||||
|
||||
Reference in New Issue
Block a user