Skip to content

Commit ffd4a4b

Browse files
committed
narrowed typing for stream data
1 parent 3182776 commit ffd4a4b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"test:watch": "eslint --fix && jest --updateSnapshot --watchAll"
116116
},
117117
"types": "dist/index.d.ts",
118-
"version": "7.0.5",
118+
"version": "7.0.6",
119119
"dependencies": {
120120
"@webkrafters/eagleeye": "^1.0.6"
121121
}

src/main/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class ObservableContext<T extends State> {
9696
*/
9797
get useStream() {
9898
const stream = this.consumer.stream;
99-
return <S extends SelectorMap>( selectorMap? : S ) => {
99+
return <const S extends SelectorMap>( selectorMap? : S ) => {
100100
const [ channel ] = useState(() => stream( selectorMap ));
101101
const [ store, setStore ] = useState(() => ({
102102
data: channel.data,
@@ -136,7 +136,7 @@ export class ObservableContext<T extends State> {
136136
* @param [selectorMap] - Key:value pairs where `key` => arbitrary key given to a Store.data property holding a state slice and `value` => property path to a state slice used by this component: see examples below. May add a mapping for a certain arbitrary key='state' and value='@@STATE' to indicate a desire to obtain the entire state object and assign to a `state` property of Store.data. A change in any of the referenced properties results in this component render. When using '@@STATE', note that any change within the state object will result in this component render.
137137
* @see {useStream} for selectorMap sample
138138
*/
139-
private _connect = <S extends SelectorMap>( selectorMap? : S ) => {
139+
private _connect = <const S extends SelectorMap>( selectorMap? : S ) => {
140140
const ctx = this;
141141
function connector<P extends ExtractInjectedProps<T, S>>(
142142
WrappedComponent : ElementType<ConnectProps<P, T, S>>

0 commit comments

Comments
 (0)