# Is it possible to call a loadData function after finishing another one?

**URL:** <https://community.embeddable.com/t/is-it-possible-to-call-a-loaddata-function-after-finishing-another-one/106>\
**Category:** FAQs\
**Created:** [April 2, 2025, 12:37pm UTC](https://community.embeddable.com/t/is-it-possible-to-call-a-loaddata-function-after-finishing-another-one/106 "2025-04-02T12:37:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ella-embeddable](https://dub1.discourse-cdn.com/flex013/user_avatar/community.embeddable.com/ella-embeddable/32/15_2.png) [@ella-embeddable](https://community.embeddable.com/u/ella-embeddable)\
**Post date:** [April 2, 2025, 12:37pm UTC](https://community.embeddable.com/t/is-it-possible-to-call-a-loaddata-function-after-finishing-another-one/106/1 "2025-04-02T12:37:51Z")

</div>

Right now, we don’t have an _official_ way of doing `loadData(...).then(...)`, but we have a react hook called `useEmbeddableState` which you can use to “hack it” if you really need to`useEmbeddableState` basically allows you to pass `state` back and forth between your `.emb.ts` file and the react component (example [here](https://docs.embeddable.com/development/loading-data#2-filtering-example)). Because of that, you can set up a flow like this:

- first `loadData` runs in your `.emb.ts` file
- results are passed to react component
- you can use `useEmbeddableState` to pass appropriate state back to the `.emb.ts` file
- `.emb.ts` file reacts to the change of state, and calls the second `loadData` call
