https://github.com/charlypoly/redux-hydrate
Hydrate framework for Redux
https://github.com/charlypoly/redux-hydrate
react redux
Last synced: about 1 month ago
JSON representation
Hydrate framework for Redux
- Host: GitHub
- URL: https://github.com/charlypoly/redux-hydrate
- Owner: charlypoly
- License: mit
- Created: 2017-06-28T19:57:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T20:10:18.000Z (almost 9 years ago)
- Last Synced: 2025-03-30T11:02:37.228Z (about 1 year ago)
- Topics: react, redux
- Size: 1.95 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redux-hydrate
Hydrate framework for Redux
```typescript
const container = Hydrate.createContainer();
interface Chat {
id: string;
message_ids?: string[]
}
container.register('Chat', {
hasMany: ['Messages']
});
// ...
container.reduxMiddleware();
interface ConnectedProps {
users?: Users[];
messages?: Message[];
message_attachments: MessageAttachment[];
}
interface ComponentProps {
chat: Chat;
}
interface ComponentState {}
type Props = ConnectedProps & ComponentProps;
class Chat extends React.Component {
render() {
return
;
}
}
export default Hydrate.connect(
{
chat: {
users: { ensure: true },
messages: {
message_attachments: {
ensure: true
}
},
}
}
Chat
);
```