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
/** | |
* Creates a state management system using JavaScript Proxies | |
* Includes support for batched updates to optimize performance | |
*/ | |
function createStateManager(initialState = {}) { | |
const listeners = new Set(); | |
let batchingEnabled = false; | |
let batchedChanges = new Map(); // Store changes during batch updates | |
/** |
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
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" ================ General Config ==================== | |
set number "Line numbers are good | |
set backspace=indent,eol,start "Allow backspace in insert mode | |
set history=1000 "Store lots of :cmdline history | |
set showcmd "Show incomplete cmds down the bottom |
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
/** | |
* The following flatten method is added to the Array prototype. | |
* The method can directly be called on the Array object and will flatten it. | |
* The contents of this file can be copy pasted into a browser window console and run. | |
*/ | |
Array.prototype.flatten = function () { | |
var array = this; | |
var flatArray = this.flatArray || []; |
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
module.exports = function (grunt) { | |
var serveStatic = require('serve-static'); | |
var LIVERELOAD_PORT = 35729; // Default port | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig( | |
{ | |
clean : { //cleans the dist folder | |
build: { | |
src: ['dist/*'] |
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
import AppDispatcher from '../dispatcher/AppDispatcher'; | |
import {EventEmitter} from 'events'; | |
import AppConstants from '../constants/AppConstants'; | |
let _articles = []; | |
function _addArticle(article) { | |
_articles.push(article); | |
} |
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
import dataHelper from './DataHelper'; | |
import LoginActions from '../actions/LoginActionCreators'; | |
let AuthService = { | |
login: function (email, password) { | |
dataHelper.fetchPost('session', {email: email, password: password}) | |
.then(resp => { | |
let {token,expires,user} = resp; | |
LoginActions.loginUser(token, expires,user); |
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
import React from 'react'; | |
import ArticleStore from '../stores/ArticleStore'; | |
import ArticleList from './articleList'; | |
class Home extends React.Component { | |
constructor(props) { | |
super(props); | |
var params = this.props.params; | |
this.state = {articles: ArticleStore.getAll()}; | |
} |
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
{ | |
"name": "react-proj", | |
"version": "1.0.0", | |
"description": "A base to start a react+flux app", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack-dev-server --hot --inline" | |
}, | |
"author": "NoshGhazanfar", | |
"license": "ISC", |