dva
Advanced tools
Comparing version 0.0.5 to 0.0.6
## `0.0.6` | ||
- Change `app.start(elementId)` to `app.start(domElement)` | ||
## `0.0.5` | ||
@@ -3,0 +7,0 @@ |
@@ -67,3 +67,3 @@ 'use strict'; | ||
function start(rootId) { | ||
function start(container) { | ||
var _marked = [rootSaga].map(_regenerator2.default.mark); | ||
@@ -73,3 +73,3 @@ | ||
(0, _utils.check)(rootId, _utils.is.string, 'RootId must be string'); | ||
(0, _utils.check)(container, _utils.is.element, 'Container must be DOMElement'); | ||
(0, _utils.check)(_routes, _utils.is.notUndef, 'Routes is not defined'); | ||
@@ -201,3 +201,3 @@ var sagas = {}; | ||
_react2.default.createElement(Routes, { history: history }) | ||
), document.getElementById(rootId)); | ||
), container); | ||
} | ||
@@ -204,0 +204,0 @@ |
@@ -6,5 +6,14 @@ 'use strict'; | ||
}); | ||
exports.is = undefined; | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
exports.check = check; | ||
exports.warn = warn; | ||
exports.log = log; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function check(value, predicate, error) { | ||
@@ -39,2 +48,5 @@ if (!predicate(value)) { | ||
}, | ||
element: function element(n) { | ||
return (typeof n === 'undefined' ? 'undefined' : (0, _typeof3.default)(n)) === 'object' && n.nodeType && n.nodeName; | ||
}, | ||
array: Array.isArray, | ||
@@ -41,0 +53,0 @@ jsx: function jsx(v) { |
{ | ||
"name": "dva", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Front-end framework based on react, redux, react-redux, react-router and redux-saga, inspired by elm and choo.", | ||
@@ -21,3 +21,2 @@ "repository": { | ||
], | ||
"main": "lib/index.js", | ||
"author": "chencheng <sorrycc@gmail.com>", | ||
@@ -79,7 +78,8 @@ "license": "MIT", | ||
"src", | ||
"dist", | ||
"effects.js", | ||
"router.js", | ||
"fetch.js", | ||
"dist" | ||
"index.js" | ||
] | ||
} |
@@ -67,3 +67,3 @@ # dva | ||
// 5. Start | ||
app.start('root'); | ||
app.start(document.getElementById('root')); | ||
``` | ||
@@ -73,3 +73,3 @@ | ||
- [Count](./examples/count) | ||
- [Count](./examples/count) ([jsfiddle](https://jsfiddle.net/3d9njnka/)) | ||
- [Popular Products](./examples/popular-products) | ||
@@ -83,3 +83,3 @@ - [Friend List](./examples/friend-list) | ||
dva 是守望先锋 (overwatch) 的英雄之一。我喜欢使用这个角色,她有强大的机甲,是个坚实的肉盾,并且她是唯一背景是真实的电竞选手,来自韩国。 | ||
dva 是守望先锋 (overwatch) 里的[英雄](http://ow.blizzard.cn/heroes/dva)。我喜欢使用这个角色,拥有强大的机甲,是个坚实的肉盾,并且她是唯一背景是真实的电竞选手,来自韩国。 | ||
@@ -86,0 +86,0 @@ ## License |
@@ -32,4 +32,4 @@ import React from 'react'; | ||
function start(rootId, opts = {}) { | ||
check(rootId, is.string, 'RootId must be string'); | ||
function start(container, opts = {}) { | ||
check(container, is.element, 'Container must be DOMElement'); | ||
check(_routes, is.notUndef, 'Routes is not defined'); | ||
@@ -104,3 +104,3 @@ let sagas = {}; | ||
</Provider> | ||
), document.getElementById(rootId)); | ||
), container); | ||
} | ||
@@ -107,0 +107,0 @@ |
@@ -21,2 +21,3 @@ | ||
number : n => typeof n === 'number', | ||
element : n => typeof n === 'object' && n.nodeType && n.nodeName, | ||
array : Array.isArray, | ||
@@ -23,0 +24,0 @@ jsx : v => v && v.$$typeof && v.$$typeof.toString() === 'Symbol(react.element)', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1023574
19
16217
2