hunk.code_window:       // Increment the ref count.
         subscriptions.set(subscriptionKey, refCount + 1)
         if (!refCount) {
           const dispose = subscribe(originKey, { next })
           if (typeof dispose !== 'function') {
             throw new Error(
               'The `subscribe` function must return a function to unsubscribe.'
             )
  
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.after_edit:         const dispose = subscribe(args, { next })
  
hunk.file_path: subscription/src/index.ts
hunk.type: replace
file: import { stableHash } from './hash'
  import { isFunction } from './shared'
  
  import type { Key } from '../types'
  
  export const serialize = (key: Key): [string, Key] => {
    if (isFunction(key)) {
      try {
        key = key()
      } catch (err) {
        // dependencies not ready
        key = ''
      }
    }
  
    // Use the original key as the argument of fetcher. This can be a string or an
    // array of values.
    const args = key
  
    // If key is not falsy, or not an empty array, hash it.
    key =
      typeof key == 'string'
        ? key
        : (Array.isArray(key) ? key.length : key)
        ? stableHash(key)
        : ''
  
    return [key, args]
  }
  