jasonmerino / react-native-realm

A higher-order component for listening to Realm data in React components.
https://www.npmjs.com/package/react-native-realm
63 stars 10 forks source link

does react-native-realm support decorator syntax? #8

Open tomprogers opened 6 years ago

tomprogers commented 6 years ago

I use the decorator pattern for all top-level route components, e.g.:

@connect((state, props) => ({
  users: state.users.filter((u) => u.isActive !== props.selectedUserGroupId)
}))
export default class SceneHome extends Component {
  render() { /* stuff */ }
}

Can connectRealm be used in a similar way? Or is there a different export for that use-case?

jasonmerino commented 6 years ago

@tomprogers no, at this time it does not support the decorator syntax for connecting realm data. I would be open to implementing it in the future or merge a PR with that functionality. From what I know about decorators it would cause a breaking change in how you connect the components up, which I'm not opposed to, but is just something that we would need to be aware of and communicate properly.