Skip to content

Commit 27c7a96

Browse files
feat: focus @focus/core on its purpose, Reducer and Lens, not utils.
1 parent fecea84 commit 27c7a96

File tree

10 files changed

+25
-17
lines changed

10 files changed

+25
-17
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"nxConsole.generateAiAgentRules": true
3+
}

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
export * from './lib/Collection';
2-
export * from './lib/flow';
31
export * from './lib/Lens';
4-
export * from './lib/noop';
52
export * from './lib/Reducer';

packages/core/src/lib/noop/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/react-connect/src/lib/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
// https://react.dev/reference/react/useSyncExternalStore
22

33
import { useSyncExternalStore } from 'react';
4-
import { createLens, Lens, noop } from '@focus/core';
4+
import { createLens, Lens } from '@focus/core';
55
import { createStore, Logger } from '@focus/store';
66

7+
const noop = () => {
8+
// noop
9+
};
10+
711
export const connect = <State>(initialState: State, logger: Logger = noop) => {
812
const store = createStore(initialState, logger);
913

File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Reducer } from '../Reducer';
1+
import { Reducer } from '@focus/core';
22

33
export const flow =
44
<State>(...fns: Reducer<State>[]): Reducer<State> =>

packages/store/src/lib/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { createCollection, flow, Lens, noop, Reducer } from '@focus/core';
1+
import { Lens, Reducer } from '@focus/core';
2+
import { flow } from './flow';
3+
import { createCollection } from './Collection';
24

35
export type Subscriber = () => void;
46

@@ -19,6 +21,10 @@ export type Store<State> = FocusedStore<State> & {
1921

2022
export type Logger = (log: object) => void;
2123

24+
const noop = () => {
25+
// noop
26+
};
27+
2228
export const createStore = <State>(
2329
initialState: State,
2430
logger: Logger = noop

0 commit comments

Comments
 (0)