Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
cb8911d
updating README.md
smartcoindev389 May 15, 2018
4b09141
minor example tweaks
smartcoindev389 May 15, 2018
7540fc6
fixing logo
smartcoindev389 May 15, 2018
90f3887
cleanup
smartcoindev389 May 15, 2018
cad8157
cleanup
smartcoindev389 May 15, 2018
01264a8
fix logo width
smartcoindev389 May 15, 2018
a06fc37
fix examples root route
smartcoindev389 May 15, 2018
a633915
fix examples root route
smartcoindev389 May 15, 2018
5c1fe88
progress on stepper demo
smartcoindev389 May 16, 2018
f83bba1
typo
smartcoindev389 May 16, 2018
a2fa491
color
smartcoindev389 May 16, 2018
71852b3
typo
smartcoindev389 May 16, 2018
106c28c
center logo
smartcoindev389 May 16, 2018
238fb19
bump
smartcoindev389 May 16, 2018
c9c88a1
fix spacing
smartcoindev389 May 16, 2018
c529eb1
fixed initial render
smartcoindev389 May 16, 2018
a1f02e2
adding behavior to receiveProps
smartcoindev389 May 17, 2018
f5ec5b8
bump
smartcoindev389 May 17, 2018
b8f4ce6
Adding `receiveProps`
smartcoindev389 May 17, 2018
f5a9a9f
updating to receiveProps patterns
smartcoindev389 May 18, 2018
2a9c1b8
splitting into Stream and Subscribe
smartcoindev389 May 18, 2018
34a55ba
fixing Stepper
smartcoindev389 May 18, 2018
395c985
fixing tests
smartcoindev389 May 19, 2018
d1efcd0
version bump
smartcoindev389 May 19, 2018
1c33a55
adding a typeahead example
smartcoindev389 May 19, 2018
93480c9
moving data
smartcoindev389 May 19, 2018
d441826
adding examples back to readme
smartcoindev389 May 19, 2018
4aa9666
adding drag demo
smartcoindev389 May 19, 2018
07bfc05
subscribe then pipe fix
smartcoindev389 May 19, 2018
06f3936
remove console.log
smartcoindev389 May 19, 2018
e320f29
adding an optional "plans" property
smartcoindev389 May 19, 2018
f03b64a
working on mergePlans
smartcoindev389 May 21, 2018
0994611
fixed mergePlans order
smartcoindev389 May 21, 2018
9f44ba5
fixing more demos
smartcoindev389 May 21, 2018
e94e3a5
refactor to streamProps and StreamProps
smartcoindev389 May 22, 2018
3bc3187
all demos updated
smartcoindev389 May 22, 2018
8e9df5f
fixing tests
smartcoindev389 May 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .vscode/settings.json

This file was deleted.

13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# react-streams

![react-streams logo](./logo.svg)
```bash
npm i react-streams rxjs
```

<p align="center">

<img src="https://rawgit.com/johnlindquist/react-streams/master/logo.svg" alt="react-streams logo" width="300px;"/>
</p>

## Play with Examples at [codesandbox.io](https://codesandbox.io/s/github/johnlindquist/react-streams/tree/master/examples?module=%2Fhello%2Findex.js)

## Docs in Progress 😬
10,000 changes: 10,000 additions & 0 deletions cypress/fixtures/10000people.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions cypress/fixtures/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const todos = require("./todos")
const people = require("./10000people")
module.exports = () => ({
todos,
people
})
16 changes: 16 additions & 0 deletions cypress/fixtures/todos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[{
"text": "Eat",
"done": false,
"id": 1
},
{
"text": "Sleep",
"done": false,
"id": 2
},
{
"text": "Code",
"done": false,
"id": 3
}
]
File renamed without changes.
3 changes: 2 additions & 1 deletion cypress/integration/ajax_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ describe("Ajax", () => {
cy.command("launch", "ajax")
})

it("should load and display the third Todo", () => {
it("should load and display the second and third Todo", () => {
cy.contains("2. Sleep")
cy.contains("3. Code")
})
})
9 changes: 0 additions & 9 deletions cypress/integration/basic_spec.js

This file was deleted.

53 changes: 0 additions & 53 deletions cypress/integration/combineState_spec.js

This file was deleted.

12 changes: 6 additions & 6 deletions cypress/integration/context_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ describe("Context", () => {
cy.get("#message").should("have.text", "Hello")
})

it("should change to 'Bye' when clicking bye", () => {
cy.get('[aria-label="show bye message"]').click()
cy.get("#message").should("have.text", "Bye")
it("should change to 'On' when clicking on", () => {
cy.get('[aria-label="change message to on"]').click()
cy.get("#message").should("have.text", "On")
})

it("should change to the 'Yo' when clicking yo", () => {
cy.get('[aria-label="show yo message"]').click()
cy.get("#message").should("have.text", "Yo")
it("should change to the 'Off' when clicking off", () => {
cy.get('[aria-label="change message to off"]').click()
cy.get("#message").should("have.text", "Off")
})
})
24 changes: 0 additions & 24 deletions cypress/integration/converge_spec.js

This file was deleted.

14 changes: 14 additions & 0 deletions cypress/integration/generic_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe("generic", () => {
it("should stream in 0, 1, 2", () => {
cy.clock()
cy.visit("http://localhost:4321/generic")
cy.contains("Wait...")
cy.contains("Wait longer...")
cy.tick(500)
cy.contains("Hello")
cy.tick(2500)
cy
.get('[style="padding: 2rem;"] > :nth-child(1) > :nth-child(3)')
.contains("Hello")
})
})
22 changes: 22 additions & 0 deletions cypress/integration/mergePlans_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe("mergePlans", () => {
beforeEach(() => {
cy.command("launch", "mergePlans")
cy.get("input").clear()
})
it("should have an empty list", () => {
cy.get("ul").should("be.empty")
})

it("should still be empty with 1 char", () => {
cy.get("input").type("a")
cy.get("ul").should("be.empty")
})

it("should receive results with 2 chars then clear after delete", () => {
cy.get("input").type("ab")
cy.get("ul").should("not.be.empty")

cy.get("input").type("{backspace}")
cy.get("ul").should("be.empty")
})
})
54 changes: 54 additions & 0 deletions cypress/integration/mergeSources_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
describe("Assign", () => {
beforeEach(() => {
cy.command("launch", "mergeSources")
cy.get(".count > button:first").as("countButton")
cy.get(".count > h3").as("countText")
cy.get(".name > h3").as("nameText")
cy.get(".nameAndCount > h3").as("nameAndCountText")
})

it("should start with 5 in both 'count' and 'nameAndCount'", () => {
cy.get("@countText").should("have.text", "5 apples")
cy.get("@nameAndCountText").should("have.text", "John has 5 apples")
})

it("should have 'John' in both 'name' and 'nameAndCount'", () => {
cy.get("@nameText").should("have.text", "John")
cy.get("@nameAndCountText").should("have.text", "John has 5 apples")
})

it("should change both 'count' and 'nameAndCount' when clicking buttons", () => {
cy.get("@countButton").click()
cy.get("@countText").should("have.text", "6 apples")
cy.get("@nameAndCountText").should("have.text", "John has 6 apples")

cy.get(".nameAndCount > button:first").click()
cy.get("@countText").should("have.text", "7 apples")
cy.get("@nameAndCountText").should("have.text", "John has 7 apples")

cy.get(".nameAndCount > button:last").click()
cy.get("@countText").should("have.text", "6 apples")
cy.get("@nameAndCountText").should("have.text", "John has 6 apples")

cy.get(".count > button:last").click()
cy.get("@countText").should("have.text", "5 apples")
cy.get("@nameAndCountText").should("have.text", "John has 5 apples")
})

it("should change both 'name' and 'nameAndCount' when entering text", () => {
cy
.get(".name > input")
.clear()
.type("Mindy")
cy.get("@nameText").should("have.text", "Mindy")
cy.get("@nameAndCountText").should("have.text", "Mindy has 5 apples")

cy
.get(".nameAndCount > input")
.first()
.clear()
.type("Ben")
cy.get("@nameText").should("have.text", "Ben")
cy.get("@nameAndCountText").should("have.text", "Ben has 5 apples")
})
})
17 changes: 17 additions & 0 deletions cypress/integration/nested_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe("Ajax", () => {
beforeEach(() => {
cy.clock()
cy.command("launch", "nested")
})

it("should load and display the second and third Todo", () => {
cy.tick(1000)
cy.contains("0")
cy.tick(1000)
cy.contains("1")
cy.contains("0")
cy.tick(1000)
cy.contains("2")
cy.contains("1")
})
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe("Hello, world!", () => {
describe("Basic", () => {
it("should display 'Wait...' then 'Hello'", () => {
cy.clock()
cy.visit("http://localhost:4321/hello")
cy.visit("http://localhost:4321/pipe")
cy.contains("Hello, world!")
})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe("Text", () => {
beforeEach(() => {
cy.visit("http://localhost:4321/text")
cy.visit("http://localhost:4321/plans")
})

it("should start with 'Hello'", () => {
Expand Down
56 changes: 56 additions & 0 deletions cypress/integration/stepper_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
describe("Stepper", () => {
beforeEach(() => {
cy.visit("http://localhost:4321/stepper")
cy.get(":nth-child(1) > input").as("min")
cy.get(":nth-child(2) > input").as("max")
cy.get(":nth-child(3) > input").as("step")
cy.get('[aria-label="Increment value"]').as("inc")
cy.get('[aria-label="Decrement value"]').as("dec")
cy.get('[type="text"]').as("value")
})

it("should increase and decrease by the step amount", () => {
cy.get("@value").should("have.value", "10")
cy.get("@inc").click()
cy.get("@value").should("have.value", "11")
cy.get("@dec").click()
cy.get("@value").should("have.value", "10")

cy
.get("@step")
.clear()
.type("2")

cy.get("@value").should("have.value", "10")
cy.get("@inc").click()
cy.get("@value").should("have.value", "12")
cy.get("@dec").click()
cy.get("@value").should("have.value", "10")
})

it("should stop at max and min", () => {
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()
cy.get("@inc").click()

cy.get("@value").should("have.value", "15")

cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()
cy.get("@dec").click()

cy.get("@value").should("have.value", "10")
})
})
7 changes: 7 additions & 0 deletions cypress/integration/streamProps_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe("stream", () => {
it("should stream in 0, 1, 2", () => {
cy.visit("http://localhost:4321/streamProps")
cy.contains("Hello, world!")
cy.contains("Bonjour, John!")
})
})
16 changes: 16 additions & 0 deletions cypress/integration/stream_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe("stream", () => {
it("should stream in 0, 1, 2", () => {
cy.clock()
cy.visit("http://localhost:4321/stream")
cy.tick(250)
cy.contains("0")
cy.tick(250)
cy.contains("1")
cy.tick(250)
cy.contains("2")
cy.tick(250)
cy.contains("3")
cy.tick(250)
cy.contains("4")
})
})
Loading