-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update examples and add clearHistory
- Loading branch information
Showing
25 changed files
with
176 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# `clearHistory()` | ||
|
||
Clear the history of published events. | ||
|
||
#### Example | ||
|
||
Assuming that our application has published one event, here is an example. | ||
|
||
```js | ||
let history = refractionInstance.getHistory(); | ||
/* [{ | ||
type: 'newMessage', | ||
payload: { | ||
chatroom: 'refraction-chatroom', | ||
sender: 'example_user', | ||
message: 'Hi all!', | ||
}, | ||
}] */ | ||
refractionInstance.clearHistory(); | ||
history = refractionInstance.getHistory(); | ||
/* [] */ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# `getHistory()` | ||
|
||
Return the history of published events. | ||
Returns the history of published events. | ||
|
||
#### Returns | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
import React from 'react'; | ||
import InputContainer from '../containers/InputContainer'; | ||
import Label from './Label'; | ||
import InputName from '../containers/inputs/InputName'; | ||
import InputSurname from '../containers/inputs/InputSurname'; | ||
import InputAddress from '../containers/inputs/InputAddress'; | ||
import LabelContainer from '../containers/LabelContainer'; | ||
import PlayButton from '../containers/PlayButton'; | ||
import PlayButton from '../containers/buttons/PlayButton'; | ||
import ClearButton from '../containers/buttons/ClearButton'; | ||
/* eslint-enable import/no-unresolved */ | ||
|
||
export default () => ( | ||
<div> | ||
<p>Write something in the input field and then Click the button</p> | ||
<InputContainer /> | ||
<p>Write your data and click play.</p> | ||
<InputName label="Name: " /> | ||
<InputSurname label="Surname: " /> | ||
<InputAddress label="Address: " /> | ||
<Label text="Name: " /> | ||
<LabelContainer /> | ||
<PlayButton /> | ||
<br /> | ||
<PlayButton text="Play!" /> | ||
<ClearButton text="Clear History" /> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
import React from 'react'; | ||
import Label from './Label'; | ||
/* eslint-enable import/no-unresolved */ | ||
|
||
export default class extends React.Component { | ||
export default class Input extends React.Component { | ||
|
||
static propTypes = { | ||
value: React.PropTypes.string.isRequired, | ||
label: React.PropTypes.string, | ||
} | ||
|
||
static defaultProps = { | ||
value: '', | ||
} | ||
|
||
render() { | ||
const { label, ...others } = this.props; | ||
return ( | ||
<input {...this.props} /> | ||
<div> | ||
<Label text={label} /> | ||
<input style={{ marginLeft: 8 }} {...others} /> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import getButtonContainer from '../ButtonContainer'; | ||
|
||
export default getButtonContainer('clear'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import getButtonContainer from '../ButtonContainer'; | ||
|
||
export default getButtonContainer('play'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import getInputContainer from '../InputContainer'; | ||
|
||
export default getInputContainer('onAddressChange'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import getInputContainer from '../InputContainer'; | ||
|
||
export default getInputContainer('onNameChange'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import getInputContainer from '../InputContainer'; | ||
|
||
export default getInputContainer('onSurnameChange'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.