Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bs-react-native-websocket
Advanced tools
$ yarn add bs-react-native-websocket react-native-websocket
Then update your bsconfig.json
, add bs-react-native-websocket
to bs-dependencies.
"bs-dependencies": ["bs-react-native-websocket"]
Usage is very similliar to react-native-websocket.
Example:
type state = {
socketRef: ref(option(ReasonReact.reactRef)),
};
let setSocketRef = (theRef, {ReasonReact.state}) =>
state.socketRef := Js.Nullable.toOption(theRef);
let component = ReasonReact.reducerComponent("Component");
let make =
(
_children,
) => {
...component,
initialState: () => {socketRef: ref(None)},
render: self =>
<View>
<ReactNativeWebsocket
url="ws://localhost:5000"
onOpen={() => Js.log("successfull connection")}
onMessage={
event =>
Js.log(event) // event is a Js.dict object
}
onError={() => Js.log("get error")}
onClose={() => Js.log("connection closed")}
ref={self.handle(setSocketRef)}
reconnect=true
/>
</View>,
};
Example of sending data:
// socket is ref to ReactNativeWebsocket component
// data is a stringifiedData that you want to send
ReactNativeWebsocket.send(socketRef, data);
MIT
PR's are welcome!
FAQs
Buckle Script bindings for react-native-websocket
The npm package bs-react-native-websocket receives a total of 4 weekly downloads. As such, bs-react-native-websocket popularity was classified as not popular.
We found that bs-react-native-websocket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.