Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SimpleRedux] Add simpleRootRawSelector #258

Merged
merged 2 commits into from Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Expand Up @@ -12,7 +12,7 @@
{
"definitionName": "lockStepVersion",
"policyName": "MiskWeb",
"version": "0.1.5-19",
"version": "0.1.5-20",
"nextBump": "prerelease"
}
// {
Expand Down
10 changes: 5 additions & 5 deletions examples/tabs/palette-exemplar/package.json
Expand Up @@ -22,9 +22,9 @@
"zip": "tar --exclude='.gitignore' --exclude='.old_build_files' --exclude='package.json' --exclude='package-lock.json' --exclude='prettier.config.js' --exclude='tsconfig.json' --exclude='tslint.json' --exclude='webpack.config.js' --exclude='yarn.lock' --exclude='demo' --exclude='lib' --exclude='.DS_Store' --exclude='*.log' --exclude='node_modules' --exclude='palette-exemplar.tgz' -czvf palette-exemplar.tgz ./"
},
"dependencies": {
"@misk/common": "0.1.5-19",
"@misk/core": "0.1.5-19",
"@misk/simpleredux": "0.1.5-19",
"@misk/common": "0.1.5-20",
"@misk/core": "0.1.5-20",
"@misk/simpleredux": "0.1.5-20",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand Down Expand Up @@ -55,8 +55,8 @@
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/history": "^4.7.2",
"@types/node": "^10.12.18",
"@types/react": "^16.7.18",
Expand Down
10 changes: 5 additions & 5 deletions examples/tabs/palette/package.json
Expand Up @@ -22,9 +22,9 @@
"zip": "tar --exclude='.gitignore' --exclude='.old_build_files' --exclude='package.json' --exclude='package-lock.json' --exclude='prettier.config.js' --exclude='tsconfig.json' --exclude='tslint.json' --exclude='webpack.config.js' --exclude='yarn.lock' --exclude='demo' --exclude='lib' --exclude='.DS_Store' --exclude='*.log' --exclude='node_modules' --exclude='palette.tgz' -czvf palette.tgz ./"
},
"dependencies": {
"@misk/common": "0.1.5-19",
"@misk/core": "0.1.5-19",
"@misk/simpleredux": "0.1.5-19",
"@misk/common": "0.1.5-20",
"@misk/core": "0.1.5-20",
"@misk/simpleredux": "0.1.5-20",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand Down Expand Up @@ -55,8 +55,8 @@
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/history": "^4.7.2",
"@types/node": "^10.12.18",
"@types/react": "^16.7.18",
Expand Down
6 changes: 3 additions & 3 deletions packages/@misk/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/cli",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web CLI Build Tool",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -28,8 +28,8 @@
"yargs": "^12.0.4"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/fs-extra": "^5.0.4",
"@types/klaw": "^3.0.0",
"@types/lodash": "^4.14.121",
Expand Down
15 changes: 13 additions & 2 deletions packages/@misk/cli/src/utils/changelog.ts
@@ -1,6 +1,7 @@
export enum MiskVersion {
"latest" = "0.1.5-19",
"alpha" = "0.1.5-19",
"latest" = "0.1.5-20",
"alpha" = "0.1.5-20",
"v015_20" = "0.1.5-20",
"v015_19" = "0.1.5-19",
"v015_18" = "0.1.5-18",
"v015_16" = "0.1.5-16",
Expand Down Expand Up @@ -112,6 +113,16 @@ export const getPackageVersion = (
}

export const MiskTabVersions: IMiskTabVersions = {
[MiskVersion.v015_20]: {
[MiskPkg.cli]: `${[MiskVersion.v015_20]}`,
[MiskPkg.common]: `${[MiskVersion.v015_20]}`,
[MiskPkg.core]: `${[MiskVersion.v015_20]}`,
[MiskPkg.dev]: `${[MiskVersion.v015_20]}`,
[MiskPkg.simpleredux]: `${[MiskVersion.v015_20]}`,
[MiskPkg.tslint]: `${[MiskVersion.v015_20]}`,
date: "2019-04-05",
notes: "SimpleRedux: Add simpleRootRawSelector."
},
[MiskVersion.v015_19]: {
[MiskPkg.cli]: `${[MiskVersion.v015_19]}`,
[MiskPkg.common]: `${[MiskVersion.v015_19]}`,
Expand Down
6 changes: 3 additions & 3 deletions packages/@misk/common/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/common",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Common Libraries, Styles",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -65,8 +65,8 @@
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
10 changes: 5 additions & 5 deletions packages/@misk/core/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/core",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Core",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -33,8 +33,8 @@
"updateDevCache": "cd ..; ./updateLocalCache.sh"
},
"dependencies": {
"@misk/common": "0.1.5-19",
"@misk/simpleredux": "0.1.5-19",
"@misk/common": "0.1.5-20",
"@misk/simpleredux": "0.1.5-20",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand Down Expand Up @@ -66,8 +66,8 @@
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
2 changes: 1 addition & 1 deletion packages/@misk/dev/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/dev",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Build and Dev Tools",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down
8 changes: 4 additions & 4 deletions packages/@misk/simpleredux/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/simpleredux",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web SimpleRedux",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -33,7 +33,7 @@
"updateDevCache": "cd ..; ./updateLocalCache.sh"
},
"dependencies": {
"@misk/common": "0.1.5-19",
"@misk/common": "0.1.5-20",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand Down Expand Up @@ -65,8 +65,8 @@
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-19",
"@misk/tslint": "0.1.5-19",
"@misk/dev": "0.1.5-20",
"@misk/tslint": "0.1.5-20",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
31 changes: 31 additions & 0 deletions packages/@misk/simpleredux/src/utilities.ts
Expand Up @@ -108,6 +108,22 @@ const selectSubState: <
return state[domain]
}

const rawSubStateSelector: <
IState extends { [key: string]: ISubState & any },
ISubState
>(
domain: string
) => OutputSelector<IState, any, (res: ISubState) => any> = <
IState extends { [key: string]: ISubState },
ISubState
>(
domain: string
) =>
createSelector(
selectSubState<IState, ISubState>(domain),
state => state
)

const immutableSubStateSelector: <
IState extends { [key: string]: ISubState & any },
ISubState extends { toJS: () => IRootState }
Expand All @@ -124,6 +140,21 @@ const immutableSubStateSelector: <
state => state.toJS()
)

/**
* simpleRootRawSelector is a Redux selector of a subState based on a domain string
* @param domain
* @param state
*
* Returns the raw stored object from Redux (in contrast to simpleRootSelector)
*/
export const simpleRootRawSelector = <
IState extends { [key: string]: ISubState & any },
ISubState
>(
domain: string,
state: IState
) => rawSubStateSelector<IState, ISubState>(domain)(state)

/**
* simpleRootSelector is a Redux selector of a subState based on a domain string
* @param domain
Expand Down
2 changes: 1 addition & 1 deletion packages/@misk/tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@misk/tslint",
"version": "0.1.5-19",
"version": "0.1.5-20",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web TsLint",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down