magpie-base
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "magpie-base", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Provides base components for _magpie frontend projects", | ||
@@ -5,0 +5,0 @@ "author": "_magpie project", |
@@ -20,2 +20,6 @@ # magpie-base | ||
## Development principles | ||
* Components should not expose CSS classes for manipulation but instead offer customization either via unstyled slots or via props. | ||
* Pre-packaged screens are more of a convenience should be rather easy to replicate with normal userland code | ||
### Docs | ||
@@ -22,0 +26,0 @@ In order to spin up a local web server with the docs run `npm run docs`. |
@@ -14,5 +14,4 @@ import { Socket as PhoenixSocket } from 'phoenix'; | ||
export default class Socket extends EventEmitter { | ||
constructor($magpie, socketURL, errorhandler) { | ||
constructor(experimentId, socketURL, errorhandler) { | ||
super(); | ||
this.$magpie = $magpie; | ||
this.errorHandler = (er) => { | ||
@@ -24,6 +23,7 @@ this.state = states.ERROR; | ||
this.participantId = generateId(40); | ||
this.experimentId = experimentId; | ||
this.phoenix = new PhoenixSocket(socketURL, { | ||
params: { | ||
participant_id: this.participantId, | ||
experiment_id: this.$magpie.experimentId | ||
experiment_id: experimentId | ||
} | ||
@@ -64,6 +64,6 @@ }); | ||
if (!this.chain || !this.realization) { | ||
return | ||
return; | ||
} | ||
this.roomChannel = this.phoenix.channel( | ||
`interactive_room:${this.$magpie.id}:${this.chain}:${this.realization}`, | ||
`interactive_room:${this.experimentId}:${this.chain}:${this.realization}`, | ||
{ participant_id: this.participantId } | ||
@@ -70,0 +70,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2264565
35
3