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

How is DataObjectFactory typing determined? #5489

Closed
tylerbutler opened this issue Mar 11, 2021 · 2 comments
Closed

How is DataObjectFactory typing determined? #5489

tylerbutler opened this issue Mar 11, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation status: stale
Milestone

Comments

@tylerbutler
Copy link
Member

Consider this declaration:

    private static readonly factory = new DataObjectFactory(
        TableDocumentType,
        TableDocument,
        [
            SparseMatrix.getFactory(),
            SharedNumberSequence.getFactory(),
        ],
        {},
        [
            TableSlice.getFactory().registryEntry,
        ],
    );

According to VSCode intellisense, the inferred type of factory is DataObjectFactory<TableDocument, object, object, IEvent>.

But in this other case:

export const BubblebenchInstantiationFactory = new DataObjectFactory(
    Bubblebench.Name,
    Bubblebench,
    [SharedTree.getFactory()],
    {},
);

In this case, intellisense infers the type as DataObjectFactory<Bubblebench, object, undefined, IEvent>. What is the safest type to use for the generics if I'm not passing registryEntries and runtimeFactory, and not using providers?

@tylerbutler tylerbutler added the documentation Improvements or additions to documentation label Mar 11, 2021
@tylerbutler tylerbutler added this to the May 2021 milestone Apr 18, 2021
@curtisman curtisman modified the milestones: May 2021, June 2021 Apr 28, 2021
@tylerbutler tylerbutler modified the milestones: June 2021, Next Jun 24, 2021
@msftbot
Copy link
Contributor

msftbot bot commented Dec 22, 2021

This issue has been automatically marked as stale because it has had no activity for 180 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!

@tylerbutler tylerbutler removed their assignment Mar 2, 2022
@msftbot
Copy link
Contributor

msftbot bot commented Aug 29, 2022

This issue has been automatically marked as stale because it has had no activity for 180 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!

@msftbot msftbot bot closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation status: stale
Projects
None yet
Development

No branches or pull requests

2 participants