diff --git a/examples/counter/package.json b/examples/counter/package.json index 86e10a82..d7254fad 100644 --- a/examples/counter/package.json +++ b/examples/counter/package.json @@ -5,6 +5,7 @@ "dependencies": { "@ice/store": "^1.3.4", "react": "^16.8.6", + "react-app-polyfill": "^1.0.6", "react-dom": "^16.8.6" }, "devDependencies": { @@ -23,12 +24,14 @@ "production": [ ">0.2%", "not dead", - "not op_mini all" + "not op_mini all", + "ie 11" ], "development": [ "last 1 chrome version", "last 1 firefox version", - "last 1 safari version" + "last 1 safari version", + "ie 11" ] } } \ No newline at end of file diff --git a/examples/counter/src/index.tsx b/examples/counter/src/index.tsx index de0a0689..9d612d47 100644 --- a/examples/counter/src/index.tsx +++ b/examples/counter/src/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { createStore } from '@ice/store'; +import 'react-app-polyfill/ie11'; +import 'react-app-polyfill/stable'; const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time)); @@ -8,8 +10,8 @@ const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), tim const counter = { state: 0, reducers: { - increment:(prevState) => prevState + 1, - decrement:(prevState) => prevState - 1, + increment: (prevState) => prevState + 1, + decrement: (prevState) => prevState - 1, }, effects: () => ({ async asyncDecrement() { @@ -29,7 +31,7 @@ const store = createStore(models); // 3️⃣ Consume model const { useModel } = store; function Counter() { - const [ count, dispatchers ] = useModel('counter'); + const [count, dispatchers] = useModel('counter'); const { increment, asyncDecrement } = dispatchers; return (