Skip to content

Support custom listening/interception of mutations  #87

@mikegai

Description

@mikegai

Would be good to have listeners on or custom functions for then, insert!, insert-unconditional!, retract!

At least four potential use cases:

  1. Integrate in a parallel eav store (i.e. Datascript) for dynamic pull queries. User-supplied functions could perform mutations on a Datascript store at the same time as mutating Clara's session which would make them synchronized. This could relax the need for precept (while growing) to have an answer for every use case.

  2. Server synchronization streams: Streaming to server might be easiest to handle as listeners/interceptors on mutation stream

  3. Completely different streaming way to update view

  4. Custom truth constraint maintenance (extend/tweak/relax constraints imposed by our schema implementation)

Note: we may want at some point mutation events themselves to pass through the rule system as action/commands (or something like them) so that rules can operate over not just "current state" (as now) but over the change events themselves. This could solve the above in a different way.

We may split this issue into listeners vs. custom mutation functions if we decide one way or the other or both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions