withvoid / melting-pot Goto Github PK
View Code? Open in Web Editor NEWA react utility library.
Home Page: https://melting-pot.netlify.com
License: MIT License
A react utility library.
Home Page: https://melting-pot.netlify.com
License: MIT License
Proposal for hook
const [on, set] = React.useState(initialState);
return { on, set, reset, toggle };
Where
We need to add an issue template for when someone wants to suggest a new feature
& he/she creates an issue for that.
We need to add a PULL_REQUEST template.
Currently the demos in the docs
for hooks
are like below;
docs/hooks/useActive/index.mdx
We need to change the structure to this
docs/hooks/useActive.mdx
We need to come up with an API design that uses the event listener mousemove
// usage
const { x, y } = useMouseMove();
const useMouseMove = () => {
const [coords, setCoords] = React.useState({ 0, 0 });
const onHandleMouseMove = event => {
setCoords({ x, y })
};
React.useEffect(() => {
window.addEventListener()
return () => {
window.removeEventListener()
}
});
return coords;
}
Currently in docs we have to access the core modules via relative paths e.g, import { useOnlineStatus } from '../../../src';
we need to replace it with import { useOnlineStatus } from @withvoid/melting-pot;
For this we need to add a plugin in the doczrc.js
that handles an alias
similar to what webpack does.
This could help in reducing boilerplate using DUCKS while writing actions and reducers. Use would need to include respective creators utils for constants, actions and reducers. Hence it will help in writing much cleaner code and fast development.
Currently there is a issue with CodeSandbox
, that is causing error for docz
to open in code snippets in codeSandbox
Please add eslint react hooks plugin to ensure enforcement of Rules of Hooks.
npm package eslint-plugin-react-hooks, should be added.
Add a similar hook that replicates React componentWillUnmount life cycle as hook.
Idea:
We can have a similar approach as useDidMount
Add a similar hook that replicates React componentDidUpdate life cycle as hook.
Idea:
We can have a similar approach as useDidMount
Current useFormField
returns the follow;
const { value, set, reset, bind } = useFormField('');
Let's add dirty
, pristine
states to useFormField hook, similar to Angular form handling hooks
[x] I have looked at the documentation Melting-pot
Add templates for when someone want to file an issue.
Add a Pull request template
that tells the user what is the protocol for creating a pull request. You can take some content from the Contributing.md
docs for this.
Reference: https://github.com/withvoid/melting-pot/blob/master/CONTRIBUTING.md
Things that the template should have
Add an example of using useScreenType
in the documentation.
Proposed API
const form = useForm({
name: { value: '', isRequired: true },
age: { value: '' }, // isRequired not given, consider false.
});
const onSubmit = e => {
e.preventDefault();
if (!form.isValid) {
alert('Missing required fields*');
return;
}
// after some operations
// reset form.
form.reset();
};
return (
<form onSubmit={onSubmit}>
<input type="text" {...form.name.bind} />
{form.name.isDirty && form.name.isRequired && <p>Required field*</p>}
<input type="text" {...form.age.bind} />
{form.age.isDirty && form.age.isRequired && <p>Required field*</p>}
<button type="submit">Send</button>
</form>
)
This will be built on top of useFormField
hook
Add an npm ignore file & remove
& other directories from being published to npm.
We need to come up with a better getting started guide content wise in the documentation.
[x] I have looked at the documentation Melting-pot
+ git remote add upstream http://github.com/withvoid/melting-pot.git
- git remote add upstream [email protected]:withvoid/melting-pot.git
Update a valid upstream path in Contributing.md
file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.