adrianmcli / Omg Counters
ð Increment decrement counters using various frontend frameworks.
Stars: â 44
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Omg Counters
Displayjs
A simple JavaScript framework for building ambitious UIs ð
Stars: â 590 (+1240.91%)
Mutual labels: frameworks, frontend
Front End Performance Checklist
ðŪ ë ëđ ëĨīęē ėëíë íëĄ íļėë ėąëĨ ėēīíŽëĶŽėĪíļ
Stars: â 183 (+315.91%)
Mutual labels: reference, frontend
Checklist Tools Website
ðŋ The perfect Checklist Website for meticulous developers.
Stars: â 73 (+65.91%)
Mutual labels: reference, frontend
Front End Checklist
ð The perfect Front-End Checklist for modern websites and meticulous developers
Stars: â 57,386 (+130322.73%)
Mutual labels: reference, frontend
C Cpp Notes
Notes about modern C++, C++11, C++14 and C++17, Boost Libraries, ABI, foreign function interface and reference cards.
Stars: â 363 (+725%)
Mutual labels: examples, reference
Golang For Nodejs Developers
Examples of Golang compared to Node.js for learning
Stars: â 2,698 (+6031.82%)
Mutual labels: examples, reference
Front End Performance Checklist
ðŪ The only Front-End Performance Checklist that runs faster than the others
Stars: â 13,815 (+31297.73%)
Mutual labels: reference, frontend
Front End Design Checklist
ð The Design Checklist for Creative Web Designers and Patient Front-End Developers
Stars: â 4,136 (+9300%)
Mutual labels: reference, frontend
Py2rs
A quick reference guide for the Pythonista in the process of becoming a Rustacean
Stars: â 690 (+1468.18%)
Mutual labels: examples, reference
Unicode Bidirectional
A Javascript implementation of the Unicode 9.0.0 Bidirectional Algorithm
Stars: â 35 (-20.45%)
Mutual labels: frontend
Medlaunch
A Windows (.NET) Front-End for the Mednafen Emulator
Stars: â 37 (-15.91%)
Mutual labels: frontend
Ng Zorro Antd
Angular UI Component Library based on Ant Design
Stars: â 7,841 (+17720.45%)
Mutual labels: frontend
Vue Beautiful Chat
A simple and beautiful Vue chat component backend agnostic, fully customisable and extendable.
Stars: â 979 (+2125%)
Mutual labels: frontend
Blaze
⥠File sharing progressive web app built using WebTorrent and WebSockets
Stars: â 991 (+2152.27%)
Mutual labels: frontend
Restful.js
A pure JS client for interacting with server-side RESTful resources. Think Restangular without Angular.
Stars: â 977 (+2120.45%)
Mutual labels: frontend
Curriculum
Overview of the different modules and learning goals of the program.
Stars: â 40 (-9.09%)
Mutual labels: frontend
Rcppexamples
Examples of using Rcpp to interface R and C++
Stars: â 33 (-25%)
Mutual labels: examples
Purescript Halogen Storybook
A library to assemble examples or develop components separately.
Stars: â 33 (-25%)
Mutual labels: examples
Medguireborn
MedGui Reborn is a frontend/launcher (GUI) for Mednafen multi emulator, written in VB .Net with Microsoft Visual Studio Community
Stars: â 40 (-9.09%)
Mutual labels: frontend
âïļïļ Increment/decrement counters using various frontend frameworks.
When a hello world is too simple, but a todo app is too complex.
No counters were harmed in the making of these examples.
Attribution
- AngularJS (@housseindjirdeh)
- Angular 2+ (@ashwin-sureshkumar)
- MobX (@teesloane)
- Choo (@jelanithompson)
- Marko (@patrick-steele-idem)
Table of Contents
- Vanilla JS
- jQuery
- RxJS
- React
- React + Redux
- AngularJS
- Angular 2+
- Hyperapp
- Vue.js
- Elm
- Cycle.js
- Jumpsuit
- Mobx
- Choo
- Marko
Don't see your favorite framework? Make a PR! (see contributing guidelines)
Vanilla JS
<!-- html -->
<h1 class="count"></h1>
<button class="increment" onclick="increment()">Increment</button>
<button class="decrement" onclick="decrement()">Decrement</button>
// javascript
let count = 0
const $count = document.getElementsByClassName('count')[0]
$count.textContent = count
function increment() { $count.textContent = ++count }
function decrement() { $count.textContent = --count }
jQuery
<!-- html -->
<h1 class="count"></h1>
<button class="increment">Increment</button>
<button class="decrement">Decrement</button>
// javascript
let count = 0
$('.count').text(count)
$('.increment').on('click', () => $('.count').text(++count))
$('.decrement').on('click', () => $('.count').text(--count))
RxJS
<!-- html -->
// <h1 id="count"></h1>
// <button id="increment">Increment</button>
// <button id="decrement">Decrement</button>
// javascript
const $factory = id => Rx.Observable.fromEvent(document.getElementById(id), 'click')
const setCount = count => document.getElementById('count').textContent = count
const inc$ = $factory('increment').mapTo(1)
const dec$ = $factory('decrement').mapTo(-1)
Rx.Observable.merge(inc$, dec$)
.startWith(0)
.scan((a, b) => a + b)
.subscribe(setCount)
React
class Counter extends React.Component {
state = {count: 0}
increment = e =>
this.setState({ count: this.state.count + 1 })
decrement = e =>
this.setState({ count: this.state.count - 1 })
render = () =>
<div>
<h1>{this.state.count}</h1>
<button onClick={this.increment}>Increment</button>
<button onClick={this.decrement}>Decrement</button>
</div>
}
React + Redux
import { createStore } from 'redux'
const reducer = (state = 0, action) => {
switch (action.type) {
case 'INCREMENT': return state + 1
case 'DECREMENT': return state - 1
default: return state
}
}
const store = createStore(reducer)
var Counter = ({ count, onIncrement, onDecrement }) => (
<div>
<h1>{count}</h1>
<button onClick={onIncrement}>Increment</button>
<button onClick={onDecrement}>Decrement</button>
</div>
)
const render = () => {
ReactDOM.render(
<Counter
count={store.getState()}
onIncrement={()=> store.dispatch({type: 'INCREMENT'})}
onDecrement={()=> store.dispatch({type: 'DECREMENT'})}
/>,
document.querySelector('body')
)
}
store.subscribe(render)
render()
AngularJS
const CounterComponent = {
template: `
<div>
<h1>{{ $ctrl.counter }}</h1>
<button ng-click="$ctrl.increaseCounter()">Increment</button>
<button ng-click="$ctrl.decreaseCounter()">Decrement</button>
</div>
`,
controller: class CounterController {
constructor() {
this.counter = 0
}
increaseCounter() {
this.counter++
}
decreaseCounter() {
this.counter--
}
}
}
export default CounterComponent
Angular 2+
import { Component } from '@angular/core'
@Component({
selector: 'counter',
template : `
<div>
<h1>{{counter}}</h1>
<button (click)="onIncrement()">Increment</button>
<button (click)="onDecrement()">Decrement</button>
</div>
`
})
export class CounterComponent {
counter: number = 0
onIncrement() {
this.counter++
}
onDecrement() {
this.counter--
}
}
Hyperapp
app({
model: 0,
update: {
add: model => model + 1,
sub: model => model - 1
},
view: (model, actions) =>
<div>
<h1>{model}</h1>
<button onclick={actions.add}>Increment</button>
<button onclick={actions.sub}>Decrement</button>
</div>
})
Vue.js
<!-- html -->
<div id="app">
<h1>{{ count }}</h1>
<button v-on:click="increment">Increment</button>
<button v-on:click="decrement">Decrement</button>
</div>
// javascript
new Vue({
el: '#app',
data: { count: 0 },
methods: {
increment: function() { this.count++ },
decrement: function() { this.count-- }
}
})
Elm
import Html exposing (beginnerProgram, div, h1, button, text)
import Html.Events exposing (onClick)
main =
beginnerProgram { model = 0, view = view, update = update }
view model =
div []
[ h1 [] [ text (toString model) ]
, button [ onClick Increment ] [ text "increment" ]
, button [ onClick Decrement ] [ text "decrement" ]
]
type Msg = Increment | Decrement
update msg model =
case msg of
Increment ->
model + 1
Decrement ->
model - 1
Cycle.js
const xs = xstream.default
const {div, button, h1, makeDOMDriver} = CycleDOM
function main(sources) {
const action$ = xs.merge(
sources.DOM.select('.dec').events('click').mapTo(-1),
sources.DOM.select('.inc').events('click').mapTo(+1)
)
const count$ = action$.fold((x, y) => x + y, 0)
const vdom$ = count$.map(count =>
div([
h1(count.toString()),
button('.dec', 'Decrement'),
button('.inc', 'Increment')
])
)
return { DOM: vdom$ }
}
Jumpsuit
const CounterState = State({
initial: { count: 0 },
increment: ({ count }) => ({ count: count + 1 }),
decrement: ({ count }) => ({ count: count - 1 })
})
const Counter = Component({
render() {
return (
<div>
<h1>{ this.props.count }</h1>
<button onClick={ Actions.increment }>Increment</button>
<button onClick={ Actions.decrement }>Decrement</button>
</div>
)
}
}, (state) => ({ count: state.counter.count }))
const globalState = { counter: CounterState }
Render(globalState, <Counter/>)
Mobx
const store = new class CounterStore {
@observable count = 0
@action increment = () => this.count++
@action decrement = () => this.count--
}
const Counter = observer(() => {
return (
<div>
<h1>{store.count}</h1>
<button onClick={store.increment}>Increment</button>
<button onClick={store.decrement}>Decrement</button>
</div>
)
})
Choo
app.model({
state: { count: 0 },
reducers: {
increment: (state) => ({ count: state.count + 1 }),
decrement: (state) => ({ count: state.count - 1 })
}
})
const view = (state, previousState, send) => {
return html`<div>
<h1>${state.count}</h1>
<button onclick=${increment}>Increment</button>
<button onclick=${decrement}>Decrement</button></div>`
function increment() { send('increment') }
function decrement() { send('decrement') }
}
app.router([['/', view]])
document.body.appendChild(app.start())
Marko
class {
onCreate() {
this.state = {count: 0};
}
increment(delta) {
this.state.count += delta;
}
}
<div>
<h1>${state.count}</h1>
<button on-click('increment', 1)>Increment</button>
<button on-click('increment', -1)>Decrement</button>
</div>
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].