Skip to content

Commit

Permalink
Fix regex pattern for different compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
kalvinpearce committed Nov 17, 2019
1 parent 446d28f commit a90cefd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const createStore = <State>(initialState: State) => {
callback: (state: T) => void,
) => {
// Little messy way of grabbing the state path from the params
const res = stateValue.toString().match(/\.(.*);/);
const res = stateValue.toString().match(/\.([a-z\.]*)/);
// This should always pass but is needed for intellisense
if (res && res.length > 1) {
const key = res[1];
Expand Down

0 comments on commit a90cefd

Please sign in to comment.