Skip to content

Commit

Permalink
fix: enable creating the store with only rootSlice & container
Browse files Browse the repository at this point in the history
  • Loading branch information
carere committed Nov 14, 2024
1 parent b9f20ef commit 1c1253d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
14 changes: 11 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
"editor.insertSpaces": true,
"editor.indentSize": "tabSize",
"editor.codeActionsOnSave": {
"source.fixAll.biome": "always",
"source.organizeImports.biome": "always",
"quickfix.biome": "always"
"source.removeUnusedImports": "always"
},
"[yaml,yml]": {
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter"
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
Expand All @@ -22,6 +29,8 @@
"editor.defaultFormatter": "biomejs.biome"
},
"todo-tree.general.tags": ["BONUS", "PERF", "TODO"],
"cSpell.language": "en",
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"Abatan",
"biomejs",
Expand All @@ -35,6 +44,5 @@
"tsup",
"upserter",
"upserters"
],
"testing.automaticallyOpenPeekView": "never"
]
}
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"useIgnoreFile": true,
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"organizeImports": {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
15 changes: 12 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@ prepare-commit-msg:
commands:
commitzen:
interactive: true
run: LEFTHOOK=0 bun cz
run: bun cz
env:
LEFTHOOK: 0

pre-commit:
parallel: true
commands:
sort-package-json:
glob: "package.json"
run: bun sort-package-json {staged_files}
biome:
glob: "*.{js,ts,tsx,json}"
stage_fixed: true
lint:
glob: "*.{js,ts,tsx,json,jsonc}"
run: bun biome check --write {staged_files}
stage_fixed: true
format:
glob: "*.{js,ts,tsx,json,jsonc}"
run: bun biome format --write --no-errors-on-unmatched {staged_files}
stage_fixed: true
12 changes: 1 addition & 11 deletions src/configureStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReplaySubject, Subject, mergeMap, of } from "rxjs";
import { ReplaySubject, Subject } from "rxjs";
import { createStore, produce } from "solid-js/store";
import type { AnyEventCreator, DevTools, Event, Store, StoreOption } from "./types";

Expand All @@ -23,16 +23,6 @@ export const configureStore = <S extends object, C>(
You may read the docs in order to understand how to use Solux and its architecture.
`);

if (container && rootEpic === undefined)
throw Error(`
You should not provide a container without providing a root epic !!
The container is only used with root epic, so if you do not use epics,
you should not provide one.
You may read the docs in order to understand how to use Solux and its architecture.
`);

if (rootSlice === undefined && rootEpic === undefined)
throw Error(`
You configured the store with no root epic and no root slice !!
Expand Down

0 comments on commit 1c1253d

Please sign in to comment.