asyncLocalStorage.enterWith(store)


示例:

const store = { id: 1 };
asyncLocalStorage.enterWith(store);
asyncLocalStorage.getStore(); // 
someAsyncOperation(() => {
  asyncLocalStorage.getStore(); // 
});
const store = { id: 1 };

emitter.on('my-event', () => {
  asyncLocalStorage.enterWith(store);
});
emitter.on('my-event', () => {
  asyncLocalStorage.getStore(); // 
});

asyncLocalStorage.getStore(); // 
emitter.emit('my-event');
asyncLocalStorage.getStore(); //