@mica/sdk (SDK contract v1)
    Preparing search index...

    Function createReactionStore

    • The reactions primitive (MICA-98): one keyed cache, one batched read, one optimistic toggle, for every surface that lets a player react to something.

      Blabber's DMs had all of this written out inside the app — a writable map, an empty constant, a batched loader and a toggle whose optimism and rollback are the fiddly part. Messages wants the same behaviour (MICA-68) and Blabs themselves plausibly will, and three copies of an optimistic update is three places for one of them to forget the rollback. An optimistic update that survives a refused write is a lie the UI tells.

      Kept out of the map rather than merged onto the rows it describes, mirroring Blabber's engagement: a reaction landing must not replace a row object and cost it its identity in a keyed {#each}.

      export const dmReactions = createReactionStore({
      load: (ids) => accounts().getReactionsFor({ app, target_table, target_ids: ids }),
      react: (id, emoji) => accounts().reactToTarget(payload(id, emoji)),
      unreact: (id, emoji) => accounts().unreactToTarget(payload(id, emoji))
      });

      It lives in kit/ and not services/ deliberately: it names no route and touches no shell, so it bundles into a sandboxed add-on unchanged — which matters, because Blabber is one (core: false).

      Parameters

      Returns ReactionStore