Socket
Socket
Sign inDemoInstall

dva

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dva

Front-end framework based on react, redux, react-redux, react-router and redux-saga, inspired by elm and choo.


Version published
Weekly downloads
14K
decreased by-10.22%
Maintainers
1
Weekly downloads
 
Created
Source

dva

NPM version

Front-end framework based on react, redux, react-redux, react-router and redux-saga, inspired by elm and choo.


Quick start with count

import React from 'react';
import dva, { connect } from 'dva';
import { Route } from 'dva/router';

const app = dva();

app.model({
  namespace: 'count',
  state: 0,
  reducers: {
    ['count/add'  ](count) { return count + 1 },
    ['count/minus'](count) { return count - 1 },
  },
});

const Count = ({ count, dispatch }) =>
  <div>
    <h2>{ count }</h2>
    <button key="add" onClick={() => { dispatch({type: 'count/add'})}}>+</button>
    <button key="minus" onClick={() => { dispatch({type: 'count/minus'})}}>-</button>
  </div>

const HomePage = connect(({ count }) => ({ count }))(Count);

app.router(
  <Route path="/" component={HomePage} />
);

app.start('root');

More examples

FAQs

Package last updated on 26 Jun 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc