Skip to content

Instantly share code, notes, and snippets.

View toddzebert's full-sized avatar
💭
coding, of course

Todd Zebert toddzebert

💭
coding, of course
View GitHub Profile
@toddzebert
toddzebert / simpleMVC.Model.js
Last active January 23, 2017 07:59
The Model module of a simple MVC implementation, in ES6 and module pattern
/**
* Simple MVC, 2016 Todd Zebert
* Model module
*/
var simpleMVC = (function simpleMVC(simple) {
'use strict';
simple.Model = function SimpleModel(data) {
this._data = data;
@toddzebert
toddzebert / index.html
Last active January 18, 2017 02:43
A small pure-JS "library" similar to jQuery's fadeIn and fadeOut methods, using requestAnimationFrame.
<!DOCTYPE html>
<head>
<script src="loa.js"></script>
</head>
<body>
<h1 id="fade-in-slow">Fade in slow</h1>
<h2 id="fade-out-slower">Fade out slower</h2>
<h3 id="fade-in-out">Fade in and out</32>
<script>
@toddzebert
toddzebert / simpleMVC.Event.js
Last active November 18, 2016 08:54
The Event module of a simple MVC implementation, in ES6 and module pattern
/**
* Event Listeners and notifications module
*/
var simpleMVC = (function simpleMVC(simple) {
'use strict';
// sender is the context of the Model or View which originates the event
simple._Event = function SimpleEvent(sender) {
this._sender = sender;
this._listeners = [];