Skip to content

Commit ca37d7d

Browse files
committed
Merge branch 'release/2.0.0'
2 parents cf6a34b + 1f86742 commit ca37d7d

19 files changed

Lines changed: 268 additions & 285 deletions

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tea-cup-core",
3-
"version": "1.5.3",
3+
"version": "2.0.0",
44
"description": "react-tea-cup core classes and utilities (Maybe etc)",
55
"author": "Rémi Van Keisbelck <remi@rvkb.com>",
66
"license": "MIT",

samples/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"react": "^16.7.0",
1212
"react-dom": "^16.7.0",
1313
"react-scripts": "3.4.3",
14-
"react-tea-cup": "^1.5.3"
14+
"react-tea-cup": "^2.0.0",
15+
"tea-cup-core": "^2.0.0"
1516
},
1617
"scripts": {
1718
"start": "react-scripts start",

samples/src/App.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,26 @@
2626
import React from 'react';
2727
import {
2828
Cmd,
29-
DevTools,
3029
Dispatcher,
3130
just,
3231
map,
3332
Maybe,
3433
maybeOf,
35-
newUrl,
3634
noCmd,
3735
nothing,
36+
Sub,
37+
Task,
38+
} from 'tea-cup-core';
39+
import {
40+
DevTools,
41+
newUrl,
3842
ProgramWithNav,
3943
QueryParams,
4044
route0,
4145
route1,
4246
route2,
4347
Router,
4448
str,
45-
Sub,
46-
Task,
4749
withReduxDevTools,
4850
} from 'react-tea-cup';
4951
import * as Counter from './Samples/Counter';

samples/src/Samples/ClassMsgs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
*/
2525

26-
import { Cmd, Dispatcher, noCmd } from 'react-tea-cup';
26+
import { Cmd, Dispatcher, noCmd } from 'tea-cup-core';
2727
import * as React from 'react';
2828

2929
export type Model = number;

samples/src/Samples/Counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
import * as React from 'react';
27-
import { Dispatcher, Cmd, Sub, noCmd } from 'react-tea-cup';
27+
import { Dispatcher, Cmd, Sub, noCmd } from 'tea-cup-core';
2828

2929
// model can be anything of course. Here, it
3030
// is just a number...

samples/src/Samples/EventsSample.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*/
2525

2626
import * as React from 'react';
27-
import { Dispatcher, Cmd, Sub, noCmd, nothing, just, Maybe, DocumentEvents, WindowEvents } from 'react-tea-cup';
27+
import { Dispatcher, Cmd, Sub, noCmd, nothing, just, Maybe } from 'tea-cup-core';
28+
import {DocumentEvents, WindowEvents} from "react-tea-cup";
2829

2930
export type Model = {
3031
clicked: Maybe<MousePosition>

samples/src/Samples/ParentChild.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
import * as Counter from './Counter';
27-
import { Dispatcher, map, Cmd, Sub } from 'react-tea-cup';
27+
import { Dispatcher, map, Cmd, Sub } from 'tea-cup-core';
2828
import * as React from 'react';
2929

3030
export type Model = ReadonlyArray<Counter.Model>;

samples/src/Samples/Perf.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
*
2424
*/
2525

26-
import { Cmd, Dispatcher, memo, noCmd } from 'react-tea-cup';
26+
import { Cmd, Dispatcher, noCmd } from 'tea-cup-core';
2727
import * as React from 'react';
28+
import { memo } from 'react-tea-cup';
2829

2930
export type Model = Readonly<{
3031
value: number;
Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1-
import { mount, ReactWrapper } from 'enzyme';
2-
import { extendJest, Cmd, Sub, Task, Program, ProgramProps, updateUntilIdle } from "react-tea-cup";
3-
import React, { ReactNode } from 'react';
4-
import { Dispatcher } from 'tea-cup-core';
1+
import { mount } from 'enzyme';
2+
import { Cmd, Dispatcher, Sub, Task } from 'tea-cup-core';
3+
import { extendJest, ProgramProps, updateUntilIdle } from 'react-tea-cup';
4+
import React from 'react';
55

66
extendJest(expect);
77

88
const init1: () => [number, Cmd<string>] = () => {
9-
return [0, toCmd('go')];
10-
}
9+
return [0, toCmd('go')];
10+
};
1111

12-
const view1: (dispatch: Dispatcher<string>, model: number) => React.ReactNode = (dispatch: Dispatcher<string>, model: number) => {
13-
return (<div className={'count'}>{model}</div>);
14-
}
12+
const view1: (dispatch: Dispatcher<string>, model: number) => React.ReactNode = (
13+
dispatch: Dispatcher<string>,
14+
model: number,
15+
) => {
16+
return <div className={'count'}>{model}</div>;
17+
};
1518

1619
const update1: (msg: string, model: number) => [number, Cmd<string>] = (msg: string, model: number) => {
17-
return [model + 1, model < 5 ? toCmd('go') : Cmd.none()];
18-
}
20+
return [model + 1, model < 5 ? toCmd('go') : Cmd.none()];
21+
};
1922

2023
// const toCmd = (msg: string) => Task.perform(Time.in(0), () => msg);
2124
const toCmd = (msg: string) => Task.perform(Task.succeed(0), () => msg);
2225

2326
describe('Test Program', () => {
24-
25-
it('expect when program is idle', () => {
26-
const props: ProgramProps<number, string> = {
27-
init: init1,
28-
view: view1,
29-
update: update1,
30-
subscriptions: () => Sub.none<string>()
31-
}
32-
return updateUntilIdle(props, mount).then(([model, wrapper]) => {
33-
expect(model).toEqual(6)
34-
// expect(wrapper).toHaveHTML('')
35-
expect(wrapper.find('.count')).toHaveText('6')
36-
})
37-
})
38-
})
27+
it('expect when program is idle', () => {
28+
const props: ProgramProps<number, string> = {
29+
init: init1,
30+
view: view1,
31+
update: update1,
32+
subscriptions: () => Sub.none<string>(),
33+
};
34+
return updateUntilIdle(props, mount).then(([model, wrapper]) => {
35+
expect(model).toEqual(6);
36+
// expect(wrapper).toHaveHTML('')
37+
expect(wrapper.find('.count')).toHaveText('6');
38+
});
39+
});
40+
});

samples/src/Samples/Raf.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
*/
2525

26-
import { Dispatcher, Cmd, noCmd, Sub, onAnimationFrame } from 'react-tea-cup';
26+
import { Dispatcher, Cmd, noCmd, Sub, onAnimationFrame } from 'tea-cup-core';
2727
import * as React from 'react';
2828

2929
export interface Model {

0 commit comments

Comments
 (0)