Useful for #178 and #162. This PR is continuation of #163 by @Uzlopak which was closed because of conflicting decorators. In this PR it uses a different approach: it uses an array of options that each will create a session instead of registering the plugin multiple times.
To use the decorators, you will have to pass the sessionKey so it selects the right key for decoding/encoding. To not introduce a breaking change, the first registered session will act as the default session.
It looks like a lot has changed, but that is mainly due to the introduction of the for-loops and indentation.
Useful for #178 and #162. This PR is continuation of #163 by @Uzlopak which was closed because of conflicting decorators. In this PR it uses a different approach: it uses an array of options that each will create a session instead of registering the plugin multiple times.
To use the decorators, you will have to pass the sessionKey so it selects the right key for decoding/encoding. To not introduce a breaking change, the first registered session will act as the default session.
It looks like a lot has changed, but that is mainly due to the introduction of the for-loops and indentation.
Checklist
npm run test
andnpm run benchmark