Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
// Search helper
const doSearch = (str) => {
  return Bacon.fromPromise($.get("https://openclipart.org/search/json/?query="+str))
}
// BaconJS (store)
const searchBus = new Bacon.Bus()
// create a stream of search results
const fullData = Bacon.combineTemplate({
  search: searchBus.toProperty(""),
  results: []
})
fullData.log()
// Event handlers (actions)
const searchChange = (e) => {
  searchBus.push(e.target.value)
}
// Function component (view)
const renderResults = (results) =>
   <div>Sorry, results not implemented for you</div>
const HelloWorld = (props) => 
  (<div>
    <h1>Search test</h1>
    <input type="text" onChange={searchChange} value={props.search} />
    <ul>
      {renderResults(props.results)}
    </ul>
  </div>);
  
// Tie everything in a bow
fullData.onValue((data) => {
  ReactDOM.render(<HelloWorld {...data} />, document.body);
})
Console
    Output 300px

    You can jump to the latest bin by adding /latest to your URL

    Dismiss x
    public
    Bin info
    anonymouspro
    0viewers