Skip to content

Commit

Permalink
fix #3650 regression clearTimers -> clearTimes (#3651)
Browse files Browse the repository at this point in the history
  • Loading branch information
urugator committed Mar 8, 2023
1 parent 5715cd7 commit dfeb1f5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/weak-oranges-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"mobx-react-lite": patch
---

fix #3650 regression clearTimers -> clearTimes
24 changes: 24 additions & 0 deletions packages/mobx-react-lite/__tests__/api.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const api = require("../src/index.ts")

test("correct api should be exposed", function () {
expect(
Object.keys(api)
.filter(key => api[key] !== undefined)
.sort()
).toEqual(
[
"isUsingStaticRendering",
"enableStaticRendering",
"observer",
"Observer",
"useLocalObservable",
"useLocalStore",
"useAsObservableSource",
"clearTimers",
"useObserver",
"isObserverBatched",
"observerBatching",
"useStaticRendering"
].sort()
)
})
2 changes: 1 addition & 1 deletion packages/mobx-react-lite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export { useLocalObservable } from "./useLocalObservable"
export { useLocalStore } from "./useLocalStore"
export { useAsObservableSource } from "./useAsObservableSource"

export const clearTimes = observerFinalizationRegistry["finalizeAllImmediately"] ?? (() => {})
export const clearTimers = observerFinalizationRegistry["finalizeAllImmediately"] ?? (() => {})

export function useObserver<T>(fn: () => T, baseComponentName: string = "observed"): T {
if ("production" !== process.env.NODE_ENV) {
Expand Down

0 comments on commit dfeb1f5

Please sign in to comment.