# Function adapter

- adapter< Source , Target >(
  __namedParameters: {
  backward: (x: Target ) => Source ;
  forward: (x: Source ) => Target ;
  store: Writable< Source >;
  },
  ): {
  set: (x: Target ) => void;
  update: (f: (x: Target ) => Target ) => void;
  subscribe(
  this: void,
  run: Subscriber< Target >,
  invalidate?: Invalidator< Target >,
  ): Unsubscriber;
  }

- #### Type Parameters

  - Source
  - Target

  #### Parameters

  - __namedParameters: {
    backward: (x: Target ) => Source ;
    forward: (x: Source ) => Target ;
    store: Writable< Source >;
    }

  #### Returns {
  set: (x: Target ) => void;
  update: (f: (x: Target ) => Target ) => void;
  subscribe(
  this: void,
  run: Subscriber< Target >,
  invalidate?: Invalidator< Target >,
  ): Unsubscriber;
  }

  - ##### set: (x: Target ) => void

  - ##### update: (f: (x: Target ) => Target ) => void

  - ##### subscribe:function

    - subscribe(
      this: void,
      run: Subscriber< Target >,
      invalidate?: Invalidator< Target >,
      ): Unsubscriber

    - Subscribe on value changes.

      #### Parameters

      - this: void
      - run: Subscriber< Target >

        subscription callback

      - `Optional` invalidate: Invalidator< Target >

        cleanup callback

      #### Returns Unsubscriber

      - Defined in node_modules/svelte/types/index.d.ts:1619
  - Defined in packages/store/src/index.ts:116