Skip to content

Commit 8702376

Browse files
authored
Merge pull request #5 from react-gx/dev
Problem of the integration with Nextjs 13 fixed
2 parents 0f7f6e2 + d3b911a commit 8702376

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+811
-163
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": ["@babel/plugin-transform-modules-commonjs"]
4+
}

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
src
3+
dist
4+
tsconfig.json

cjs/contexts/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// <reference types="react" />
2+
import { GXContextType } from "./types";
3+
declare const GXContext: import("react").Context<GXContextType>;
4+
export default GXContext;

cjs/contexts/index.js

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

cjs/contexts/index.js.map

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

cjs/contexts/types.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference types="react" />
2+
import { GXAction } from "../providers/types";
3+
export type GXSignalType<T = any> = {
4+
name: string;
5+
state: T;
6+
actions: GXActionType<T>[];
7+
};
8+
export type GXActionType<T, P = any> = {
9+
type: string;
10+
handler: (state: T, payload: P) => T;
11+
};
12+
export type DispatchedActionType = {
13+
type: string;
14+
payload: any;
15+
};
16+
export type GXContextType = {
17+
signals: GXSignalType[];
18+
dispatch: React.Dispatch<GXAction>;
19+
};

cjs/contexts/types.js

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

cjs/contexts/types.js.map

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

cjs/helpers/createSignal.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { CreateSignalOptionType } from './types';
2+
import { GXActionType } from '../contexts/types';
3+
/**
4+
* Create a signal with a state and actions for managing this state
5+
* @param options
6+
* @returns
7+
*/
8+
declare const createSignal: <T>(options: CreateSignalOptionType<T>) => {
9+
name: string;
10+
state: T;
11+
actions: GXActionType<T, any>[];
12+
};
13+
export default createSignal;

cjs/helpers/createSignal.js

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

0 commit comments

Comments
 (0)