Skip to content

Instantly share code, notes, and snippets.

@ds0nt
Created January 13, 2015 02:55
Show Gist options
  • Save ds0nt/1c6a44881386b6390865 to your computer and use it in GitHub Desktop.
Save ds0nt/1c6a44881386b6390865 to your computer and use it in GitHub Desktop.
Idea for IoC React Router
psueodocode ftw
layout ....
todo
render
<div>
<expects todolist /> //dependency inverted .. decoupled. todolist is an abstraction
</div>
todolist
render
<div>
<expects todoitem multiple>
</div>
todoitem
render
<div>this.props.name</div>
// routes
route("/", function() {
ensure("layout", todo);
ensure("todolist", todolist);
ensure("todoitem", []);
});
route("/joe", function() {
extends("/");
ensure("todoitem", joes_todo_list());
});
@ds0nt
Copy link
Author

ds0nt commented Jan 13, 2015

joes_todo_list() should be joes_todo_items, which provides todo_items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment