Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Fun React is a React framework.
Because I love functional programming and ELM, but I can only use JS in work.
Great! Fun React is perfect for you. Because it basically mimic almost everything of ELM 0.17. I bet you can know how to use Fun React right after check the following example.
The overall concept is the same: the state reducer. The main differences are:
reducers
as update
functionsprogram
instead of <Provider />
connect
.
event
: event declarationlink
: event binding between parent and childrenTODO
npm install --save fun-react cycle-react react rx
To run example
cd examples/__the_example__
npm install
npm start
then open http://localhost:8080
in browser.
import React from 'react'
import ReactDOM from 'react-dom'
import {
createProgram,
fromSimpleInit,
fromSimpleUpdate,
createTypes,
caseOf,
createView
} from 'fun-react'
// 1. define message types by function createTypes
const Msg = createTypes('INC', 'DEC')
// 2. define init data
const init = 0
// 3. define update function
const update = caseOf({
INC: (_, count) => count + 1,
DEC: (_, count) => count - 1
})
// 4. define view by function createView
const Counter = createView('Counter', ({model}, {event}) => (
<div>
<h1>Count: {model}</h1>
<button onClick={event(Msg.INC)}>INC</button>
<button onClick={event(Msg.DEC)}>DEC</button>
</div>
))
// 5. compose program by the defined `init`, `update`, `view`
const Program = createProgram({
init: fromSimpleInit(init),
update: fromSimpleUpdate(update),
view: Counter,
inputs: () => []
})
// 6. mount the Program to actual DOM
const rootEl = document.getElementById('app')
ReactDOM.render(<Program />, rootEl)
TODO
TODO
TODO
TODO
The name imply the philosophy. So why name it Fun React:
TODO explain what is Functor, and why can react element be a functor
v0.3.9
2017-04-26
FAQs
Elm like js framework built on top of cycle-react
The npm package fun-react receives a total of 7 weekly downloads. As such, fun-react popularity was classified as not popular.
We found that fun-react 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.