Reactivity adapter for sinuous
Adapter
- ✅ Automatic Cleanup
- ❌ Scope check
The API of Sinuous doesn't allow reactive scope checking. You must manually disable reactivity when making calls outside a reactive scope to avoid memory leaks. You can do this by passing { reactive: false }
to your options (e.g. <collection>.find({ ... }, { reactive: false })
).
Installation
bash
$ npm install signaldb-plugin-sinuous
Usage
js
import { api } from 'sinuous'
import reactivityAdapter from 'signaldb-plugin-sinuous'
import { Collection } from 'signaldb'
const posts = new Collection({
reactivity: reactivityAdapter,
})
api.subscribe(() => {
console.log(posts.find({ author: 'John' }).count())
})