Skip to content

@signaldb/sjs

sjsReactivityAdapter (default)

js
import { Collection } from '@signaldb/core'
import sjsReactivityAdapter from '@signaldb/sjs'
import S from 's-js'

const posts = new Collection({
  reactivity: sjsReactivityAdapter,
})

S(() => {
  console.log(posts.find({ author: 'John' }).count())
})

Reactivity adapter for usage with S.js.

The API of S.js 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 })).

Released under the MIT License.