Skip to content

withTracker with async code #393

Description

@mfeuermann

Hi developers,

I wanted to ask if it is possible to use the withTracker function call in combination with the asynchronous call that will be introduced in Meteor 3.0

I have a large application where I use the container architecture with React components
Example of container...

`import { withTracker } from 'meteor/react-meteor-data';
import {useDeps} from '@beisen/storybook-mantra-core';
import _ from 'lodash';

import locales from '../components/locales.jsx';
import {Locales} from '/lib/collections';

export const depsMapper = (context) => ({
context: () => context
});

const localesWT = withTracker(({context, id}) => {

const {Log, LocalState} = context();

let localesArray = Locales.find({language: 'en'}).fetch();

return {
localesArray
};
})(locales);

export default useDeps(depsMapper)(localesWT);
`

In the withTracker function I would like to call asynchronously however currently the content is rendered and does not wait for await...

Can we expect the withTracker function to be modified for use with Meteor.callAsync ?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions