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.
@lessondesk/react-table-context
Advanced tools
Flexible Table Provider & Consumer
import React from 'react'
import ReactDOM from 'react-dom'
import createTableContext from './react-table-context'
const Table = () => {
const [Provider, Consumer] = createTableContext(async args => {
console.log('args', args)
const response = await fetch('https://jsonplaceholder.typicode.com/todos')
const json = await response.json()
return {
meta: {
count: json.length
},
data: json
}
})
return <Provider>
<div>
<h1>Example Table</h1>
<Consumer>
{({
page, // 0
pageSize, // 10
firstPage, // true
isLoading, // false
isEmpty, // false
data, // Array[100]
meta, // Object
error, // null
filters, // Object
unappliedFilters, // Object
sorting, // Object
pageData, // Array[10]
selected, // Array[0]
search, //
setSearch, // function () {}
setPage, // function () {}
setSorting, // function () {}
setPageSize, // function () {}
refresh, // function () {}
setSelected, // function () {}
toggleSelectAll, // function () {}
setFilters, // function () {}
setUnappliedFilters, // function () {}
applyFilters // function () {}
}) => {
console.log('data', data)
return <table>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Completed</th>
</tr>
</thead>
<tbody>
{pageData.map(({ id, title, completed }) => {
return <tr key={id}>
<td>{id}</td>
<td>{title}</td>
<td>{completed ? 'Yes' : 'Nope'}</td>
</tr>
})}
</tbody>
</table>
}}
</Consumer>
</div>
</Provider>
}
function App () {
return (
<div className='App'>
<Table />
</div>
)
}
const rootElement = document.getElementById('root')
ReactDOM.render(<App />, rootElement)
This project uses node and npm.
$ npm install @lessondesk/react-table-context
$ # OR
$ yarn add @lessondesk/react-table-context
git checkout -b my-new-feature
git commit -am "Add some feature"
git push origin my-new-feature
MIT
FAQs
Flexible Table Provider & Consumer
We found that @lessondesk/react-table-context demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.