ENGLISH·COURSE API
    Preparing search index...
    • Applies a change at once, then keeps it only if the server accepts it.

      Parameters

      • apply: (state: LearnerState) => Partial<LearnerState>

        Computes the slices to change from the current state

      • request: () => Promise<boolean>

        Sends the change; resolves whether the server accepted it

      Returns Promise<boolean>

      Whether the change was kept

      The optimistic half of every learner write: readers see the change before the request answers. When the request resolves false or throws, exactly the slices apply touched are put back — anything else written meanwhile is left alone.