Thanks for the response. Okay, so the way in which you are meant to use async methods is something like this?
function inResponseToSomething() {
myStore.fetchRabbits().then(rabbits => myAction.update(rabbits)).catch(doNothing);
}
I have been instead specifying myAction.update
as the success
action in the async source. But that isn't the correct way to do things?
Hi, guys
I have a small trouble with parent and children components. So there is
Parent AltContainer -> DataLayout -> Inside DataLayout there are some another
AltContainer(s) - Big smart components.
After Parent AltContainer is cleared unlisten events in children components
don't fire.
someAction.defer()
instead of someAction()
.
componentDidMount() { MyStore.loadSomething(); }
loadSomething
dispatches a loading
action, e.g. via dataSource, to indicate busynesssuccess
hat caused the component to be mounted in the first place, and it being mounted is still part of the success
dispatch and while that hasn't finished, the system is trying to dispatch the next loading
actioncomponentDidMount() { setTimeout(() => MyStore.loadSomething()); }
SearchComponent
for searching your address then I have a MapComponent
for displaying a map. now I need to have my SearchComponent
allowing a user to put his/her address then click submit then the map location changes to the input address, and my SearchComponent
needs to have Googles AutoComplete fro places,SearchComponent
import React, { Component } from 'react'
import { MapContainer } from '../Map/MapContainer.jsx'
import Geosuggest from 'react-geosuggest'
export class SearchAddress extends Component {
constructor (props) {
super(props)
this.state = {
address: ''
}
this.handleSubmit = this.handleSubmit.bind(this)
}
handleSubmit(e) {
e.preventDefault()
console.log('value ',this.refs.srch.value)
}
onChange(){
}
render() {
return (
<div>
<form onSubmit={this.handleSubmit}>
<input size="35" ref="srch" type="search" id="search" placeholder="Search..." />
<button submit={this.handleSubmit} >Serach Address</button>
</form>
</div>
)
}
}
export function UnwrappedActions() {
if (!(this instanceof UnwrappedActions)) return new UnwrappedActions();
this.actionXXX = function(arg1, arg2) {
};
}
export default Alt.createActions(UnwrappedActions());