bobflux-monitor
Advanced tools
Comparing version 2.0.2 to 2.0.3
import * as b from 'bobril'; | ||
import { bootstrap } from 'fun-model'; | ||
import { createDefaultState} from './example/state'; | ||
import mainPage from './example/mainPage'; | ||
import monitor from './index'; | ||
import { mainPage } from './example/mainPage'; | ||
import * as monitor from './index'; | ||
// Bobflux | ||
// bootstrap(createDefaultState(), monitor()); | ||
// bootstrap(createDefaultState(), monitor.init()); | ||
// fun-model | ||
bootstrap(createDefaultState(), b.invalidate, monitor()); | ||
bootstrap(createDefaultState(), b.invalidate, monitor.init()); | ||
@@ -13,0 +13,0 @@ b.routes( |
import * as f from 'fun-model'; | ||
import appCursor from '../state'; | ||
import { appCursor } from '../state'; | ||
@@ -9,4 +9,2 @@ export const increment = f.createAction(appCursor, state => f.shallowCopy(state, copy => { | ||
copy.history = [...state.history, copy.counter]; | ||
})); | ||
export default increment; | ||
})); |
import * as b from 'bobril'; | ||
import * as f from 'fun-model'; | ||
import appCursor from './state'; | ||
import increment from './actions/increment'; | ||
import { appCursor } from './state'; | ||
import { increment } from './actions/increment'; | ||
@@ -9,3 +9,3 @@ export const mainPage = b.createComponent({ | ||
const state = f.getState(appCursor); | ||
me.children = [ | ||
me.children = <b.IBobrilChildren>[ | ||
{ tag: 'h1', children: 'Sample' }, | ||
@@ -17,7 +17,5 @@ { tag: 'button', children: 'INCREMENT', component: { onClick: increment } }, | ||
{ tag: 'p', children: `History: ${state.history.toString()}` }, | ||
{ tag: 'button', children: 'POPUP', component: { onClick: state.popup } }, | ||
{ tag: 'button', children: 'POPUP', component: { onClick: state.popup } } | ||
]; | ||
} | ||
}); | ||
export default mainPage; |
@@ -21,4 +21,2 @@ import * as f from 'fun-model'; | ||
key: '' | ||
}; | ||
export default appCursor; | ||
}; |
@@ -9,8 +9,8 @@ export function allToString(obj): string { | ||
if (Array.isArray(obj)) | ||
return `[${(<[]>obj).map(item => allToString(item))}]`; | ||
if(obj instanceof Date){ | ||
return `[${(<Object[]>obj).map(item => allToString(item))}]`; | ||
if (obj instanceof Date) { | ||
return `new Date(${(<Date>obj).getTime()})`; | ||
} | ||
if (typeof obj === 'object') { | ||
@@ -17,0 +17,0 @@ return `{ ${Object.keys(obj).map(key => `${key}: ${allToString(obj[key])}`).join(', ')} }`; |
@@ -48,2 +48,3 @@ import * as b from 'bobril'; | ||
export const monitor = init; | ||
export default init; |
{ | ||
"name": "bobflux-monitor", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Component for time travelling in bobflux/fun-model application state history.", | ||
@@ -14,3 +14,3 @@ "typescript": { | ||
"name": "Tomáš Růt", | ||
"email": "rut.tomas@hotmail.com" | ||
"email": "trut.cz@gmail.com" | ||
} | ||
@@ -17,0 +17,0 @@ ], |
@@ -11,5 +11,5 @@ # bobflux-monitor | ||
import { bootstrap } from 'bobflux'; | ||
import monitor from 'bobflux-monitor'; | ||
import * as monitor from 'bobflux-monitor'; | ||
bootstrap(createDefaultState(), monitor()); | ||
bootstrap(createDefaultState(), monitor.init()); | ||
``` | ||
@@ -20,3 +20,3 @@ ```typescript | ||
bootstrap(createDefaultState(), b.invalidate, monitor()); | ||
bootstrap(createDefaultState(), b.invalidate, monitor.init()); | ||
``` | ||
@@ -23,0 +23,0 @@ |
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"target": "es5", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"jsx": "react", | ||
"reactNamespace": "b" | ||
"reactNamespace": "b", | ||
"declaration": false, | ||
"lib": [ | ||
"es5", | ||
"dom", | ||
"es2015.core", | ||
"es2015.promise" | ||
], | ||
"removeComments": false, | ||
"noLib": false, | ||
"preserveConstEnums": false | ||
}, | ||
"compileOnSave": false, | ||
"files": [ | ||
"C:/Users/rutto/AppData/Roaming/npm/node_modules/bobril-build/typings/jasmine/jasmine.d.ts", | ||
"components/button.ts", | ||
"components/monitorPanel.ts", | ||
"components/row.ts", | ||
"components/rows.ts", | ||
"components/textbox.ts", | ||
"example.ts", | ||
"example/actions/increment.ts", | ||
"example/mainPage.ts", | ||
"example/state.ts", | ||
"helpers/string.ts", | ||
"index.ts", | ||
"node_modules/bobril/jsx.d.ts", | ||
"spec/string.spec.ts" | ||
"C:/Users/t.rut/AppData/Roaming/npm/node_modules/bobril-build/typings/jasmine/jasmine.d.ts", | ||
"node_modules/bobril/jsx.d.ts" | ||
], | ||
"include": [ | ||
"**/*" | ||
] | ||
} |
@@ -11,3 +11,6 @@ { | ||
"class-name": true, | ||
"comment-format": false, | ||
"comment-format": [ | ||
true, | ||
"check-space" | ||
], | ||
"curly": false, | ||
@@ -20,3 +23,6 @@ "eofline": false, | ||
], | ||
"interface-name": true, | ||
"interface-name": [ | ||
true, | ||
"always-prefix" | ||
], | ||
"jsdoc-format": true, | ||
@@ -58,3 +64,9 @@ "label-position": true, | ||
"no-switch-case-fall-through": true, | ||
"no-trailing-comma": true, | ||
"trailing-comma": [ | ||
true, | ||
{ | ||
"multiline": "never", | ||
"singleline": "never" | ||
} | ||
], | ||
"no-unreachable": true, | ||
@@ -79,3 +91,6 @@ "no-trailing-whitespace": false, | ||
"radix": true, | ||
"semicolon": true, | ||
"semicolon": [ | ||
true, | ||
"always" | ||
], | ||
"triple-equals": true, | ||
@@ -87,4 +102,8 @@ "typedef": [ | ||
], | ||
"typedef-whitespace": false, | ||
"use-strict": false, | ||
"typedef-whitespace": [ | ||
false | ||
], | ||
"use-strict": [ | ||
false | ||
], | ||
"variable-name": true, | ||
@@ -101,2 +120,2 @@ "whitespace": [ | ||
} | ||
} | ||
} |
25422
686