填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

StateKey

A type-safe key to use with TransferState.

查看"说明"...

type StateKey<T> = string & { __not_a_string: never; };
      
      type StateKey<T> = string & {
    __not_a_string: never;
};
    

说明

Example:

const COUNTER_KEY = makeStateKey<number>('counter'); let value = 10; transferState.set(COUNTER_KEY, value);
      
      const COUNTER_KEY = makeStateKey<number>('counter');
let value = 10;

transferState.set(COUNTER_KEY, value);