Created
June 18, 2019 06:09
-
-
Save tkssharma/c4f6e8f072de2cd2d4feae51f6d7b9cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class todosContainer extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
loading: false, | |
todos: {} | |
} | |
} | |
createNewTodo(data){ | |
Meteor.call('todo.insert', data, function(err){ | |
if(err){ | |
toast(err.message ? err.message : 'error occured') | |
}else { | |
toast('new todo has ben created'); | |
} | |
}); | |
} | |
updateTodo(data){ | |
Meteor.call('todo.updateTodo',data, function(err){ | |
if(err){ | |
toast(err.message ? err.message : 'error occured') | |
}else { | |
toast('todo has ben Updated successfully'); | |
} | |
}); | |
} | |
render(){ | |
return ( | |
return <div> | |
// render todos here | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment