This repository has been archived by the owner on Feb 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Hamilton
committed
Nov 9, 2012
1 parent
830c56a
commit 3409365
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Tinyapp - Minimal module management | ||
|
||
Tinyapp provides application module namespacing and event-based communication to help decouple and coordinate small modules, as opposed to building up a large, tightly coupled, monolithic app. | ||
|
||
Tinyapp assumes CommonJS modules, AKA Node style `require()`. | ||
|
||
Need help using CommonJS in the browser? Check out [Browserify](https://github.com/substack/node-browserify). | ||
|
||
Tinyapp exposes .loadReady() and .renderReady() methods so you can use .load() and .render() for whatever you want. Inside your module: | ||
|
||
var api = new Backbone.View.extend({ | ||
render: function render() { | ||
// do stuff to dom | ||
} | ||
}); | ||
|
||
function myLoad() { | ||
// get some data asynchronously from server | ||
} | ||
|
||
function myRender() { | ||
// draw stuff to screen | ||
} | ||
|
||
app.loadReady(myLoad); | ||
app.renderReady(myRender); | ||
app.register(namespace, api); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters