-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
242 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/dist | ||
/src/vendor | ||
/pnpm-lock.yaml | ||
/jotai | ||
dist | ||
examples | ||
node_modules | ||
website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: lint and type | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile --prefer-offline | ||
- name: Prettier | ||
run: pnpm run prettier:ci | ||
- name: Lint | ||
run: pnpm run eslint:ci | ||
- name: Type | ||
run: pnpm run typecheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile --prefer-offline | ||
- name: Run Tests | ||
run: pnpm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
import { App } from './App'; | ||
import React from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import { App } from './App' | ||
|
||
const ele = document.getElementById('app'); | ||
const ele = document.getElementById('app') | ||
if (ele) { | ||
createRoot(ele).render(React.createElement(App)); | ||
createRoot(ele).render(React.createElement(App)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const ImmediatePriority = 1; | ||
export const NormalPriority = 2; | ||
export const LowPriority = 3; | ||
export const ImmediatePriority = 1 | ||
export const NormalPriority = 2 | ||
export const LowPriority = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export { useAtomValueWithSchedule } from './useAtomValueWithSchedule'; | ||
export { useAtomWithSchedule } from './useAtomWithSchedule'; | ||
export { useSetAtomWithSchedule } from './useSetAtomWithSchedule'; | ||
export { LowPriority, NormalPriority, ImmediatePriority } from './constants'; | ||
export * from './types'; | ||
export { useAtomValueWithSchedule } from './useAtomValueWithSchedule' | ||
export { useAtomWithSchedule } from './useAtomWithSchedule' | ||
export { useSetAtomWithSchedule } from './useSetAtomWithSchedule' | ||
export { LowPriority, NormalPriority, ImmediatePriority } from './constants' | ||
export * from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { Atom, useStore } from 'jotai'; | ||
import { ImmediatePriority, LowPriority, NormalPriority } from './constants'; | ||
import { Atom, useStore } from 'jotai' | ||
import { ImmediatePriority, LowPriority, NormalPriority } from './constants' | ||
|
||
export type SetAtom<Args extends unknown[], Result> = (...args: Args) => Result; | ||
export type SetAtom<Args extends unknown[], Result> = (...args: Args) => Result | ||
|
||
export type AnyAtom = Atom<unknown>; | ||
export type AnyAtom = Atom<unknown> | ||
|
||
export type Store = ReturnType<typeof useStore>; | ||
export type Store = ReturnType<typeof useStore> | ||
|
||
export type Listener = () => void; | ||
export type Listener = () => void | ||
|
||
export type PriorityLevel = | ||
| typeof ImmediatePriority | ||
| typeof NormalPriority | ||
| typeof LowPriority; | ||
| typeof LowPriority | ||
|
||
export type Options = Parameters<typeof useStore>[0] & { | ||
delay?: number; | ||
priority?: PriorityLevel; | ||
}; | ||
delay?: number | ||
priority?: PriorityLevel | ||
} | ||
|
||
export type Task = { | ||
priority: PriorityLevel; | ||
subscribe: Listener; | ||
}; | ||
priority: PriorityLevel | ||
subscribe: Listener | ||
} |
Oops, something went wrong.