asyncCall.then(res => {
foo(res);
bar(res);
});
// тут использовать res нельзя
// только в async/await функции
counter.value = 100500;
D.prototype = Object.create(C.prototype);
D.prototype.constructor = D;
{
next: null,
value: 'xxx',
}
{
next: null,
value: 'xxx',
}
{
next: {
next: null,
value: 'yyy',
},
value: 'xxx',
}
{
next: null,
value: 'yyy',
}
{
next: {
next: {
next: null,
value: 'zzz',
},
value: 'yyy',
},
value: 'xxx',
}
{
next: null,
value: 'zzz',
}
export const decrement = () => dispatch => {
dispatch({
type: DECREMENT
});
};
dispatch => {
dispatch({
type: DECREMENT
});
};
export const decrement = () => ({ type: DECREMENT });
return {
...state,
value: state.value + 1
};
return {
value: state.value + 1
};
componentDidMount() {
const { id, getConditionById } = this.props;
getConditionById(id);
}
export const getConditionById = id => async dispatch => {
const domenPath = domen[domenKey];
const apiPath = api[apiKey];
try {
const { data } = await Api.get(`${domenPath}${apiPath}/${id}`);
dispatch({
type: `${CREATE_QUESTION}_SET_COND_QUESTION`,
payload: { body: data },
});
return data;
} catch (e) {
console.log(e);
}
};
export const clearCreateQuestion = () => ({ type: `${T.CREATE_QUESTION}_CLEAR` });
const mapDispatchToProps = {
clearCreateQuestion,
getConditionById,
};
export default connect(mapStateToProps, mapDispatchToProps)(CreateConditionComponent);
var data = {
fruits : {
Apple: 'http://.png',
Banana : 'https://.png'
},
animals : {
Apple: 'http://.png',
Banana : 'https://.png'
}