Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared object not available in preload function #899

Open
vitorclelis96 opened this issue Jun 16, 2022 · 0 comments
Open

Shared object not available in preload function #899

vitorclelis96 opened this issue Jun 16, 2022 · 0 comments
Assignees
Labels

Comments

@vitorclelis96
Copy link

In the preload function, the shared object ins't created yet.
Example:

async function preload(seneca) {
  // seneca.shared is null
  seneca.shared = {}; // Need to manually boot seneca shared

  // Now you can use the seneca.shared instance here
  seneca.shared.x = 10;
  // shared.x will be available outside
}

Fix:
Instead of manually creating seneca.shared = {}, the seneca instance should be available already in preload function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants