You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
options.state is only available on the root request, as dare traverses the tree and calls nested joined models the state is no longer there. Therefore the only reliable way has been to return the root requests initial options, i.e. dareInstance.options- the second parameter... see below
constmyModel={get(options,dareInstance){const{state}=dareInstance.options;// use the state value to modify the request}};dare.use({models: {myModel}});
It's actually pretty rare to use dareInstance for anything other than retrieving the state object made in a request. And because it's not always obvious when it should occur to the layman, let's put it on each options<{state}>
So therefore we can reliably do...
constmyModel={get(options){const{state}=options;// use the state value to modify the request}};constdare=newDare({models: {myModel}});
The text was updated successfully, but these errors were encountered:
options.state
is only available on the root request, as dare traverses the tree and calls nested joined models the state is no longer there. Therefore the only reliable way has been to return the root requests initial options, i.e.dareInstance.options
- the second parameter... see belowIt's actually pretty rare to use dareInstance for anything other than retrieving the
state
object made in a request. And because it's not always obvious when it should occur to the layman, let's put it on eachoptions<{state}>
So therefore we can reliably do...
The text was updated successfully, but these errors were encountered: