mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
lerna: split up bulk of packages
This commit is contained in:
parent
cb0b1d2410
commit
47a2e5694e
90 changed files with 0 additions and 0 deletions
8
packages/roleypoly-ui/config/demo.js
Normal file
8
packages/roleypoly-ui/config/demo.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
export default [
|
||||
'cute',
|
||||
'vanity',
|
||||
'brave',
|
||||
'proud',
|
||||
'wonderful',
|
||||
'日本語'
|
||||
].map((name, i, roles) => ({ name: `a ${name} role ♡`, color: `hsl(${(360 / roles.length) * i},40%,70%)` }))
|
17
packages/roleypoly-ui/config/redux.js
Normal file
17
packages/roleypoly-ui/config/redux.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { createStore, applyMiddleware } from 'redux'
|
||||
import { composeWithDevTools } from 'redux-devtools-extension'
|
||||
import thunkMiddleware from 'redux-thunk'
|
||||
import withNextRedux from 'next-redux-wrapper'
|
||||
import { rootReducer } from 'fast-redux'
|
||||
|
||||
export const initStore = (initialState = {}) => {
|
||||
return createStore(
|
||||
rootReducer,
|
||||
initialState,
|
||||
composeWithDevTools(applyMiddleware(thunkMiddleware))
|
||||
)
|
||||
}
|
||||
|
||||
export const withRedux = (comp) => withNextRedux(initStore, {
|
||||
debug: process.env.NODE_ENV === 'development'
|
||||
})(comp)
|
13
packages/roleypoly-ui/config/rpc.js
Normal file
13
packages/roleypoly-ui/config/rpc.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
// @flow
|
||||
import RPCClient from '../rpc'
|
||||
|
||||
const client = new RPCClient({ forceDev: false })
|
||||
|
||||
export default client.rpc
|
||||
export const withCookies = (ctx: any) => {
|
||||
if (ctx.req != null) {
|
||||
return client.withCookies(ctx.req.headers.cookie)
|
||||
} else {
|
||||
return client.rpc
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue