Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Create flat bundles & ship module entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Feb 10, 2018
1 parent 222e986 commit 257c464
Show file tree
Hide file tree
Showing 16 changed files with 6,576 additions and 1,784 deletions.
4 changes: 1 addition & 3 deletions packages/react-redux-subspace/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"presets": ["env", "react", "stage-3"]
}
{ "presets": ["./.babelrc.js"] }
14 changes: 14 additions & 0 deletions packages/react-redux-subspace/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { BABEL_ENV, NODE_ENV } = process.env

const cjs = BABEL_ENV === 'cjs' || NODE_ENV === 'test'

module.exports = {
presets: [
['env', { loose: true, modules: false }],
'react',
'stage-3',
],
plugins: [
cjs && 'transform-es2015-modules-commonjs',
].filter(Boolean),
}
33 changes: 33 additions & 0 deletions packages/react-redux-subspace/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2017, IOOF Holdings Limited.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

import * as React from 'react';
import * as Redux from 'redux';
import { MapState } from 'redux-subspace'

interface ComponentDecorator {
<TProps, TComponentConstruct extends (React.ComponentClass<TProps> | React.StatelessComponent<TProps>)>(component: TComponentConstruct): TComponentConstruct;
}

export interface Subspaced {
<TParentState, TSubState>(mapState: MapState<TParentState, any, TSubState>): ComponentDecorator;
<TParentState, TSubState>(mapState: MapState<TParentState, any, TSubState>, namespace: string): ComponentDecorator;
<TParentState, TRootState, TSubState>(mapState: MapState<TParentState, TRootState, TSubState>): ComponentDecorator;
<TParentState, TRootState, TSubState>(mapState: MapState<TParentState, TRootState, TSubState>, namespace: string): ComponentDecorator;
(namespace: string): ComponentDecorator;
}

export const subspaced: Subspaced;

export interface SubspaceProviderProps<TParentState, TRootState, TSubState> {
children: React.ReactNode;
mapState?: MapState<TParentState, TRootState, TSubState> | string;
namespace?: string;
}

export class SubspaceProvider<TParentState, TRootState, TSubState> extends React.Component<SubspaceProviderProps<TParentState, TRootState, TSubState>> { }
Loading

0 comments on commit 257c464

Please sign in to comment.