Skip to content

Commit

Permalink
chore(demos): update cerebral-demo to use tempate tag based operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Guria committed Oct 22, 2016
1 parent 105f0d8 commit d4edda7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
19 changes: 0 additions & 19 deletions packages/cerebral-demo/public/index.html
Expand Up @@ -4,28 +4,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favico.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
4 changes: 2 additions & 2 deletions packages/cerebral-demo/src/components/Demo/index.js
Expand Up @@ -22,8 +22,8 @@ export default connect({
<div>
<h1>{props.title}</h1>
<UpperTitle />
<a href='javascript:;' onClick={onFrontClicked}>Front</a>
<a href='javascript:;' onClick={onAdminClicked}>Admin</a>
<li><a href='javascript:;' onClick={onFrontClicked}>Front</a></li>
<li><a href='javascript:;' onClick={onAdminClicked}>Admin</a></li>
</div>
)
}
Expand Down
15 changes: 8 additions & 7 deletions packages/cerebral-demo/src/index.js
Expand Up @@ -6,28 +6,29 @@ import {Controller} from 'cerebral'
import {Container} from 'cerebral/react'
import Devtools from 'cerebral/devtools'
import Router from 'cerebral-router'
import {set} from 'cerebral/operators'
import {set, state} from 'cerebral/operators'

const AdminModule = {
routes: {
'/': 'routed'
},
signals: {
routed: [set('state:title', 'Admin')]
routed: [set(state`title`, 'Admin')]
}
}

const controller = Controller({
devtools: Devtools(),
router: Router(),
routes: {
'/': 'routed'
},
router: Router({
routes: {
'/': 'routed'
}
}),
state: {
title: 'Hello world!'
},
signals: {
routed: [set('state:title', 'Front page')]
routed: [set(state`title`, 'Front page')]
},
modules: {
admin: AdminModule
Expand Down

0 comments on commit d4edda7

Please sign in to comment.