piral-containers
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -6,7 +6,7 @@ "use strict"; | ||
function createState(ctx, id, data) { | ||
react_atom_1.swap(ctx, state => (Object.assign({}, state, { containers: piral_core_1.withKey(state.containers, id, data) }))); | ||
react_atom_1.swap(ctx, state => (Object.assign(Object.assign({}, state), { containers: piral_core_1.withKey(state.containers, id, data) }))); | ||
} | ||
exports.createState = createState; | ||
function destroyState(ctx, id) { | ||
react_atom_1.swap(ctx, state => (Object.assign({}, state, { containers: piral_core_1.withoutKey(state.containers, id) }))); | ||
react_atom_1.swap(ctx, state => (Object.assign(Object.assign({}, state), { containers: piral_core_1.withoutKey(state.containers, id) }))); | ||
} | ||
@@ -18,3 +18,3 @@ exports.destroyState = destroyState; | ||
const newState = dispatch(oldState); | ||
return Object.assign({}, state, { containers: piral_core_1.withKey(state.containers, id, Object.assign({}, oldState, newState)) }); | ||
return Object.assign(Object.assign({}, state), { containers: piral_core_1.withKey(state.containers, id, Object.assign(Object.assign({}, oldState), newState)) }); | ||
}); | ||
@@ -21,0 +21,0 @@ } |
@@ -13,3 +13,3 @@ "use strict"; | ||
context.defineActions(actions); | ||
react_atom_1.swap(context.state, state => (Object.assign({}, state, { containers: {} }))); | ||
react_atom_1.swap(context.state, state => (Object.assign(Object.assign({}, state), { containers: {} }))); | ||
return (api, target) => { | ||
@@ -16,0 +16,0 @@ let containers = 0; |
import * as React from 'react'; | ||
import { StateConnectorProps } from './types'; | ||
export declare function withPiletState<TState, TAction, TProps>(Component: React.ComponentType<TProps & StateConnectorProps<TState, TAction>>, id: string, actions: TAction): React.FunctionComponent<TProps>; | ||
export declare function withPiletState<TState, TAction, TProps>(Component: React.ComponentType<TProps & StateConnectorProps<TState, TAction>>, id: string, actions: TAction): React.FC<TProps>; |
{ | ||
"name": "piral-containers", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Plugin for creating a pilet state container in Piral.", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"piral-core": "^0.9.3" | ||
"piral-core": "^0.9.4" | ||
}, | ||
@@ -46,3 +46,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "a079ff637821eeacd28f1209593b778e370d0366" | ||
"gitHead": "2426a2466d490035811e382e871f1a019eae3513" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18845