New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

commander-sam

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commander-sam

DIY MVC Framework inspired by SAM pattern.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

commander-sam

DIY MVC Framework inspired by SAM pattern for my Coding Dojo.

This is an example of Todo list application (obviously!).

It separates concerns with Commands, Model and View. Has Redux inspired time travel, and component rendering inspired by React.

It's basically a DIY way of building simple web apps without reaching for heavy React/Redux libraries.

USAGE

npm start

const commander = Commander()
const render = commander.invoke.bind(commander, Actions.RenderView)
const model = Model(render)
const view = View(commander.invoke)

commander.subscribe(
  Command(Actions.Startup, () => model.propose(Actions.Startup)),
  Command(Actions.Back, () => model.propose(Actions.Back)),
  Command(Actions.Forward, () => model.propose(Actions.Forward)),
  Command(Actions.AddToDo, todo => model.propose(Actions.AddToDo, todo)),
  Command(Actions.RenderView, state => view.render(state)),
)

commander.invoke(Actions.Startup)

Keywords

command

FAQs

Package last updated on 18 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts